feat(seer): Wire explorer chat write site through SeerRun outbox#115231
feat(seer): Wire explorer chat write site through SeerRun outbox#115231trevor-e wants to merge 1 commit intotelkins/seer-run-outboxfrom
Conversation
Add an optional `run_type` parameter to `SeerAgentClient.start_run()`. When provided and the `organizations:seer-run-mirror` flag is on, the method creates a SeerRun + CellOutbox entry instead of calling Seer directly. The explorer chat endpoint now passes `run_type=SeerRunType.EXPLORER`. Other callers (trigger_autofix_agent, etc.) omit it, keeping the direct path unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Reviewed by Cursor Bugbot for commit 9e2060d. Configure here.
| "body": dict(chat_body), | ||
| "viewer_context": dict(self.viewer_context), | ||
| }, | ||
| ).save() |
There was a problem hiding this comment.
Missing OutboxFlushError handling in outbox path
High Severity
The outbox context with flush=True can raise OutboxFlushError if the signal receiver fails (e.g., Seer returns a 500, triggering a RuntimeError in handle_seer_run_create). This exception is not caught here, unlike the analogous code in search_agent_start.py which wraps the block in a try/except OutboxFlushError. Since OutboxFlushError does not inherit from SeerApiError, the endpoint's exception handler in organization_seer_agent_chat.py won't catch it either, resulting in an unhandled crash instead of a graceful error response.
Reviewed by Cursor Bugbot for commit 9e2060d. Configure here.
| run.refresh_from_db() | ||
| if run.mirror_status != SeerRunMirrorStatus.LIVE or run.seer_run_state_id is None: | ||
| raise SeerApiError("Seer run mirror failed to materialize", 500) | ||
| return run.seer_run_state_id |
There was a problem hiding this comment.
Outbox path skips explorer index triggering
Medium Severity
The outbox path returns early at line 380, completely bypassing _maybe_trigger_explorer_index_for_new_run. Since the explorer chat endpoint is the only caller passing run_type, all explorer runs routed through the outbox will never trigger project indexing or context-engine indexing, even when Seer's response indicates missing indexes. The response data containing has_explorer_index and has_org_project_context is consumed only in the receiver, which discards those fields.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9e2060d. Configure here.


Summary
run_typeparam toSeerAgentClient.start_run()— when provided andorganizations:seer-run-mirroris on, routes through the outboxrun_type=SeerRunType.EXPLORERtrigger_autofix_agent, etc.) omit it, keeping the direct path unchangedStacked on #115111. Third write site conversion (after assisted-query and legacy autofix).
Test plan
test_outbox_path_creates_run_and_returns_run_idverifies SeerRun creation, outbox dispatch, and run_id return via the clienttest_post_new_conversation_calls_clientupdated to expectrun_type=SeerRunType.EXPLORER