Repository navigation
fix(mothership): surface the real run error for browser-settled workflow tools - #9634
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; the cleanup change fixes the earlier finding without introducing a new issue. SummaryBrowser-settled workflow tools now read the saved failure message when
Reviews (2) · Last reviewed commit: "fix(mothership): clean up run logs and s..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
run_block,run_from_block,run_workflow, orrun_workflow_until_blockran in the browser and the workflow failed, the tool error the agent read was always the genericWorkflow execution failed.. The real message (<Block>: <reason>) only showed up nested inoutput.output.error.getTrustedWorkflowToolExecutionread only the top-levelexecutionData.error. Error finalization (completeWithErrorand its cost-only fallback,finalizationPath: 'force_failed') never writes that field. It stores the message asfinalOutput: { error }.finalOutput.errorwhen the run was error-finalized (force_failed). This string has already gone throughfilterForDisplayand PII redaction, and the agent already sees it nested inoutput, so nothing new is exposed.finalOutput.erroris workflow data. That case is not read. Cancelled runs are unchanged.client.tsthe message now becomes the top-level toolerrorand the persisted tool-call row error, and it is added to the trusted provenance import. It still passes throughboundRunResultForModeland the secret-provenance projection unchanged./api/copilot/confirmreads onlystatusandexecutionId, so it is not affected.Type of Change
Testing
trusted-tool-failure.integration.tsruns against real Postgres. It finalizes runs through a realLoggingSessionand reads them back throughgetTrustedWorkflowToolExecution.{ error }output returns no message. This test fails when theforce_failedgate is removed.execution-state.test.ts,mothership/request/tools/client.test.ts, andcopilot/confirm/route.test.tspass (118 tests).bun run lintpasses.Checklist
test-auditauthoring gate)