Skip to content

Fix safe-output MCP startup by packaging the memory schema validator - #67508

Closed
pelikhan wants to merge 1 commit into
mainfrom
pelikhan-safe-outputs-investigation
Closed

pelikhan wants to merge 1 commit into
mainfrom
pelikhan-safe-outputs-investigation

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Fixes #67505.

Safe outputs are broken on current main (9e123795f5), not merely experiencing agent failures. 92e400a5b2 (#67439) added a shared schema validator required by both memory_custom_validation.cjs and ledger_store.cjs, but did not include it in SAFE_OUTPUTS_FILES. The isolated safe-output MCP bundle therefore crashes during module loading.

  • Package memory_schema_contract.cjs alongside the existing memory validator.
  • Add a runtime bundle regression test that loads the HTTP entry point, stdio module, and ledger store in a fresh process; checks MCP tools/list and tools/call; and asserts the exact queued JSONL output.
  • Keep tests local: disposable bundle, restricted environment, fixture repository, isolated HOME, no listener, no GitHub writes. Do not execute setup.sh in the test because its global /tmp/gh-aw cleanup can affect other sessions.

Investigation evidence

All seven inspected failed runs at current main fail ingestion with safeoutputs MCP gateway registered 0 tools during setup:

Workflow Run
PR Sous Chef 38081557820
Issue Monster 38080766599
Daily Ambient Context Optimizer 38080698051
Failure Investigator 38080226107
Avenger 38080096304
Daily Graft Intelligence 38079994869
Daily Spec Coverage Review 38079236218

The cached MCP startup logs for run 38081557820 confirm MODULE_NOT_FOUND: ./memory_schema_contract.cjs through memory_custom_validation.cjs and safe_outputs_handlers.cjs. Its downstream green safe_outputs job only processes a synthetic report_incomplete, not the intended comments. Recent green Failure Investigator and Trajectory Grader runs skipped the agent and safe-output jobs altogether.

The recent CJS failure also fails the existing transitive-dependency test on this exact missing file.

Before the regression, PR Sous Chef run 38057639346 wrote real comments. Confirmed one destination resource through the API: #67393 (comment). These earlier writes establish historical operation, not recovery on current main.

The inspected scheduled CI failure is separate work-queue compilation/integration test failures and is not changed here.

Validation

  • Existing dependency test reproduced the omission before the fix.
  • New runtime regression reproduced the same MODULE_NOT_FOUND when the copy-list fix was temporarily omitted; passed after restoring it.
  • Targeted packaging, memory validation, and ledger store suites: 78 tests passed.
  • make fmt-cjs, make lint-cjs, and setup shell syntax check passed.
  • make agent-report-progress passed: build, typecheck, change-scoped lint, and 16 packaging tests; impacted Go tests correctly skipped because no Go files changed.

The local execution scope was reviewed for isolation and unchanged controls. No workflow was dispatched. Hosted gateway recovery and production output writes with this fix remain unverified; affected workflows must use a setup-action ref containing the fix (recompile/refresh pins where necessary).

Include memory_schema_contract.cjs in the isolated safe-output bundle and verify module loading, tool registration, and JSONL intent recording in a fresh Node process.

Fixes #67505

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@SivaKesava1

Copy link
Copy Markdown
Collaborator

Closing as a duplicate: main already has this fix from #67506 (2b5c6d4), and #67505 is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Safe outputs MCP server fails to start on main: setup.sh does not copy memory_schema_contract.cjs (regression from #67439)

2 participants