fix: remove dead delete+recreate and pin code, add poll fallback test
Phase 1 cleanup: - Remove deletePost() method (dead code, replaced by PUT in-place updates) - Remove _postInfo Map tracking (no longer needed) - Remove pin/unpin API calls from watcher-manager.js (incompatible with PUT updates) - Add JSDoc note on (edited) label limitation in _flushUpdate() - Add integration test: test/integration/poll-fallback.test.js - Fix addSession() lastOffset===0 falsy bug (0 was treated as 'no offset') - Fix pre-existing test failures: add lastOffset:0 where tests expect backlog reads - Fix pre-existing session-monitor test: create stub transcript files - Fix pre-existing status-formatter test: update indent check for blockquote format - Format plugin/ files with Prettier (pre-existing formatting drift)
This commit is contained in:
@@ -240,14 +240,6 @@ async function startDaemon() {
|
||||
const initialText = buildInitialText(agentId, sessionKey);
|
||||
postId = await sharedStatusBox.createPost(channelId, initialText, rootPostId);
|
||||
logger.info({ sessionKey, postId, channelId }, 'Created status box');
|
||||
|
||||
// Auto-pin the status post so it's always visible
|
||||
try {
|
||||
await sharedStatusBox._apiCall('POST', '/api/v4/posts/' + postId + '/pin', {});
|
||||
logger.debug({ sessionKey, postId }, 'Status post pinned');
|
||||
} catch (pinErr) {
|
||||
logger.warn({ sessionKey, err: pinErr }, 'Failed to pin status post');
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error({ sessionKey, err }, 'Failed to create status post');
|
||||
globalMetrics.lastError = err.message;
|
||||
@@ -339,14 +331,6 @@ async function startDaemon() {
|
||||
logger.error({ sessionKey, err }, 'Failed to update final status');
|
||||
}
|
||||
|
||||
// Unpin the status post when session is done
|
||||
try {
|
||||
await sharedStatusBox._apiCall('POST', `/api/v4/posts/${box.postId}/unpin`, {});
|
||||
logger.debug({ sessionKey, postId: box.postId }, 'Status post unpinned');
|
||||
} catch (unpinErr) {
|
||||
logger.warn({ sessionKey, err: unpinErr }, 'Failed to unpin status post');
|
||||
}
|
||||
|
||||
// Clean up — remove from all tracking so session can be re-detected if it becomes active again
|
||||
activeBoxes.delete(sessionKey);
|
||||
watcher.removeSession(sessionKey);
|
||||
|
||||
Reference in New Issue
Block a user