Repository navigation
refactor(mcp): bind session record tools through the shared table - #11625
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The code appears safe to merge; no actionable issues were found. SummaryMoves seven session record tools into the shared binding table. Adds
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Session record tool] --> B[Shared binding table]
B --> C[Session admission]
C --> D[Run and log operation]
D --> E{Result}
E -->|Plain value| F[Contract delivery]
E -->|CommittedValue| G[Unwrap value and receipt]
G --> F
E -->|Failure| H[Shared error delivery]
F --> I{Fits response budget?}
I -->|Yes| J[Return value]
I -->|No| K[Return overflow error with receipt]
Reviews (1) · Last reviewed commit: "refactor(mcp): bind session record tools..." · Reviewed by Greptile |
55906a7 to
b939d38
Compare
c5e221d to
a50e418
Compare
…red table (#11621) * refactor(mcp): bind Frida discovery and session tools through the shared table * refactor(mcp): bind browser observation tools through the shared table (#11622) * refactor(mcp): bind session record tools through the shared table (#11625) * fix(mcp): record a completed provider-backed workflow's Evidence once before delivery * refactor(mcp): bind Rizin debugger tools under external-mutation admission through the shared table (#11629) * refactor(mcp): bind Rizin debugger tools under external-mutation admission through the shared table * test(mcp): cancel a Rizin command during its retirement close, and route moved code to the reverse-tools lane
Summary
Binds the seven session record tools (
export_evidence_bundle,import_evidence_bundle,get_evidence_bundle,list_unknowns,record_unknown,update_unknown,verify_unknown_resolution) through the shared binding table as session-admitted value bindings, instead of seven hand-writtenregisterToolhandlers. Stacked on #11622.Problem and expected behavior
registerSessionRecordTools.tsrepeated session admission and delivery per tool, and two tools passed an overflow receipt (the committed unknown's id, revision and mutation Evidence) that the value binding could not express. Expected: the table binds them withadmitted: trueunder session admission, and a value binding can return a committed record with its receipt.Change and scope
src/server/contractToolHandler.ts:CommittedValue(a value plus the receipt an overflowing response names); the value handler delivers it with that receipt.src/server/serviceToolBindings.ts:sessionRecordsgroup ({ session, resources });committedUnknownbuilds the receipt from the session's committed unknown.src/server/registerSessionTools.ts: registerssessionRecordsbesidesessionDerivedwith session admission (withAdmittedAnalysis({ kind: "session", session }), as each handler built before).src/server/registerSessionRecordTools.ts; baseline 7 sites removed.Behavior visible to MCP clients: these tools are now logged like the other bound tools; results, errors and receipts are unchanged.
Not included: the remaining lifecycle/process tools in
registerSessionTools.ts(next PR).Contract and boundary impact
docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
evidenceImportCancellation.test.ts: its two cancellation cases observed the failure through a spy ontoCallToolResult; value failures go through the shared partial-error delivery since refactor(mcp): bind Frida discovery and session tools through the shared table #11621, so the spies now observetoPartialErrorToolResult. Assertions on the error (cancelled, exact reason, session unchanged, retry succeeds) are unchanged.serverUnknownsMcp.test.tscovers the committed-unknown receipt on overflow; unknown, bundle, overflow, lifecycle and HTTP suites run unchanged.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/mcp/serverUnknownsMcp.test.ts tests/boundary/mcp/oversizedErrorDeliveryMcp.test.ts tests/boundary/mcp/contextEvidenceOverflow.test.ts tests/boundary/mcp/evidenceImportCancellation.test.ts tests/boundary/mcp/investigationLifecycleMcp.test.ts tests/boundary/mcp/resetArtifactCleanupMcp.test.ts tests/boundary/mcp/errorEvidenceLifecycleMcp.test.ts tests/boundary/mcp/toolErrorSchemaDelivery.test.ts tests/boundary/mcp/evidenceBundleInline.test.ts tests/boundary/mcp/streamableHttpMcp.test.ts— 2 failed inevidenceImportCancellation(spy on the old delivery method), 46 passed; after the spy updateevidenceImportCancellation4 passednpm run test:focused -- tests/boundary/mcp/processCleanupRetryMcp.test.ts tests/boundary/mcp/kunaCloseRetryMcp.test.ts tests/boundary/mcp/bundleComparisonCancellation.test.ts tests/process-global/processSnapshotCleanupMcp.test.ts tests/boundary/mcp/javascriptRuntimeObservationMcp.test.ts tests/boundary/mcp/analysisViewMcp.test.ts tests/boundary/mcp/artifactMcp.test.ts— 60 passednode scripts/verify/architecture-guards.mjs --shrink-baselines— baseline lowered, passednpm run check:fast— passednpx oxfmton changed files — cleanCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.