Feat(logs) upgrade mothership chat messages to error#3772
Feat(logs) upgrade mothership chat messages to error#3772TheodoreSpeaks merged 4 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview No functional behavior changes are introduced beyond log severity (plus minor formatting around one tool-execution log call). Written by Cursor Bugbot for commit 8f74750. This will update automatically on new commits. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| const continuation = context.awaitingAsyncContinuation | ||
| if (!continuation) { | ||
| logger.info(withLogContext('No async continuation pending; finishing orchestration')) | ||
| logger.error(withLogContext('No async continuation pending; finishing orchestration')) |
There was a problem hiding this comment.
Normal flow logged as errors
High Severity
This change upgrades many successful-path logger.info messages to logger.error, so routine requests emit ERROR logs on stderr. That misclassifies healthy operations as failures and will flood error-based monitoring, making real failures harder to detect.
Additional Locations (2)
| toolName: toolCall.name, | ||
| params: toolCall.params, | ||
| } | ||
| ) |
There was a problem hiding this comment.
Tool parameters exposed in error logs
High Severity
toolCall.params is now logged with logger.error at tool start. Because production only emits ERROR by default, arbitrary tool input that was previously suppressed is now persisted in production logs, risking leakage of secrets or sensitive user data.
Greptile SummaryThis PR upgrades 30+ copilot/mothership chat log statements from Key concerns:
The better path to making these logs visible is either to raise only the specific diagnostic checkpoints to Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant ChatRoute as /api/copilot/chat
participant Orchestrator as orchestrateCopilotStream
participant SSEHandlers as SSE Handlers
participant ToolExec as executeToolAndReport
participant Monitor as Error Monitoring
Client->>ChatRoute: POST /chat
ChatRoute->>Monitor: logger.error("Received chat POST") ⚠️
ChatRoute->>Orchestrator: orchestrateCopilotStream()
Orchestrator->>Monitor: logger.error("Starting copilot orchestration") ⚠️
loop Each iteration
Orchestrator->>Monitor: logger.error("Starting orchestration loop iteration") ⚠️
Orchestrator->>SSEHandlers: process SSE events
SSEHandlers->>ToolExec: executeToolAndReport()
ToolExec->>Monitor: logger.error("Tool execution started") ⚠️
ToolExec->>Monitor: logger.error("Tool execution succeeded") ⚠️
Orchestrator->>Monitor: logger.error("Completed orchestration loop iteration") ⚠️
end
Orchestrator->>Monitor: logger.error("Completing copilot orchestration") ⚠️
ChatRoute->>Monitor: logger.error("Returning non-streaming response") ⚠️
ChatRoute->>Monitor: logger.error("Generated and saved title") ⚠️
ChatRoute-->>Client: 200 OK
Note over Monitor: Every successful chat request<br/>generates ~10+ error-level entries
|
| logger.error( | ||
| appendCopilotLogContext('Stream aborted by explicit stop', { requestId, messageId }) | ||
| ) |
There was a problem hiding this comment.
User-initiated abort logged as error
'Stream aborted by explicit stop' is triggered when a user intentionally cancels a request — it is expected, non-erroneous behavior. Logging it as error will create false positive alerts every time a user presses a stop button. The same applies to 'Stopping orchestration because request was aborted' in orchestrator/index.ts line 225.
| logger.error( | |
| appendCopilotLogContext('Stream aborted by explicit stop', { requestId, messageId }) | |
| ) | |
| logger.info( | |
| appendCopilotLogContext('Stream aborted by explicit stop', { requestId, messageId }) | |
| ) |
* feat(log): enable info logs in staging and prod * Upgrade info logs to error for message route * Add to orchestrator, remove helm shennanigans * Fix lint --------- Co-authored-by: Theodore Li <theo@sim.ai>
This reverts commit 9d1b976.
* feat(logs): add additional metadata for workflow execution logs * Revert "Feat(logs) upgrade mothership chat messages to error (#3772)" This reverts commit 9d1b976. * Fix lint, address greptile comments * improvement(sidebar): expand sidebar by hovering and clicking the edge (#3830) * improvement(sidebar): expand sidebar by hovering and clicking the edge * improvement(sidebar): add keyboard shortcuts for new workflow/task, center search modal, fix edge ARIA * improvement(sidebar): use Tooltip.Shortcut for inline shortcut display * fix(sidebar): change new workflow shortcut from Mod+Shift+W to Mod+Shift+P to avoid browser close-window conflict * fix(hotkeys): fall back to event.code for international keyboard layout compatibility * fix(sidebar): guard add-workflow shortcut with canEdit and isCreatingWorkflow checks * feat(ui): handle image paste (#3826) * feat(ui): handle image paste * Fix lint * Fix type error --------- Co-authored-by: Theodore Li <theo@sim.ai> * feat(files): interactive markdown checkbox toggling in preview (#3829) * feat(files): interactive markdown checkbox toggling in preview * fix(files): handle ordered-list checkboxes and fix index drift * lint * fix(files): remove counter offset that prevented checkbox toggling * fix(files): apply task-list styling to ordered lists too * fix(files): render single pass when interactive to avoid index drift * fix(files): move useMemo above conditional return to fix Rules of Hooks * fix(files): pass content directly to preview when not streaming to avoid stale frame * improvement(home): position @ mention popup at caret and fix icon consistency (#3831) * improvement(home): position @ mention popup at caret and fix icon consistency * fix(home): pin mirror div to document origin and guard button anchor * chore(auth): restore hybrid.ts to staging * improvement(ui): sidebar (#3832) * Fix logger tests * Add metadata to mothership logs --------- Co-authored-by: Theodore Li <theo@sim.ai> Co-authored-by: Waleed <walif6@gmail.com> Co-authored-by: Theodore Li <theo@sim.ai>


Summary
Upgrade mothership message logs to error to surface them in logs.
Type of Change
Testing
Validated that local service still runs. Validated flow shows no secrets
Checklist
Screenshots/Videos