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 <[email protected]>


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