Skip to content

fix(#1515): sequant_run reports another run's issues and verdict when its own run log is missing — a runId lookup miss falls back to the time window - #1522

Merged
admarble merged 2 commits into
mainfrom
feature/1515-fix-mcp-sequant-run-reports-another-run-s-issues-a
Oct 19, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/1515-fix-mcp-sequant-run-reports-another-run-s-issues-a

Conversation

@admarble

@admarble admarble commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A sequant_run call whose own run log is missing now reports that fact. Before, it reported another run's issues and QA verdict as its own.

  • resolveRunLog (src/mcp/tools/run.ts) accepts only the log carrying the captured runId. It retries the lookup 3 times at 200 ms for a log that is not on disk yet. After that it returns null and writes the lookup miss line to the server's stderr. It never falls back to the time window.
  • On that miss the fallback response carries runLogMissing: true, requestedIssues, and a note that names the runId and the requested issues. The note says the result is not a parsed log and that the summary counts come from the exit code only.
  • A CLI that reports no runId (older than fix(mcp): log-file lookup races on concurrent runs and stale same-issue logs #631) still uses the time-window fallback, as before.
  • The test that locked in the old behaviour is rewritten. A retry test for a log that arrives late is added.
  • docs/features/mcp-server.md documents the three new fields and the no-substitution rule. QA reported this as done, but it was missing; I added it in e447a28.

Fixes #1515

Verification

  • AC-1: npx vitest run src/mcp/tools/run.test.ts -t "captured runId miss never returns another run" → 1 passed, 0 failed.
  • AC-2: -t "missing run log is reported in the result" → 1 passed, 0 failed.
  • AC-3: rg -n 'Fell back to readLatestRunLog and returned the other-run log' src/mcp/tools/run.test.ts → no output.
  • The whole run.test.ts file → 101 passed.
  • The issue's repro, re-run on this branch: resolveRunLog("<runId with no file>", new Date()), with another run's log in the window, returns null. On main the same call returns that run's log (issues [1484]).

Mutation-verified: AC-1 — removed the return null on a captured-runId miss so the time-window fallback runs again; src/mcp/tools/run.test.ts > resolveRunLog (#631 follow-up — Gap 2 / Gap 3) > captured runId miss never returns another run (#1515) failed (1 failed, 100 passed); restored.

Mutation-verified: AC-2 — removed runLogMissing: true from buildFallbackResponse; src/mcp/tools/run.test.ts > resolveRunLog (#631 follow-up — Gap 2 / Gap 3) > missing run log is reported in the result (#1515) failed (1 failed, 100 passed); restored.

Not covered

  • No handler-level test checks that the handler passes capturedRunId to the fallback response. That wiring is a single argument. The builder and the resolver each have their own tests.
  • The fix reaches MCP callers only after a release, because the MCP server runs the published npm version.

🤖 Generated with Claude Code

…run's result

Entire-Checkpoint: b5c7957523a0
…sequant_run fallback response

Entire-Checkpoint: 1c1f3305b301
@admarble
admarble merged commit 2e887b3 into main Oct 19, 2026
8 checks passed
@admarble
admarble deleted the feature/1515-fix-mcp-sequant-run-reports-another-run-s-issues-a branch October 19, 2026 01:13
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.

fix(mcp): sequant_run reports another run's issues and verdict when its own run log is missing — a runId lookup miss falls back to the time window

1 participant