Repository navigation
feat(debuggers): name why a stopped GDB or Rizin session accepts no commands - #11185
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. |
80db626 to
68ed918
Compare
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryAdds stable stop codes to GDB and Rizin sessions without replacing their reason text.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Debugger stop: code and reason"] --> B["Session status"]
B --> C["closed_reason and closed_reason_code"]
A --> D["Stopped-session or protocol error"]
D --> E["diagnostics.session_stop"]
D --> F{"Cleanup incomplete?"}
F -->|Composed Rizin failure| G["primary_error retains the stop diagnostic"]
Reviews (4) · Last reviewed commit: "Merge branch 'main' into feat/gdb-sessio..." · Reviewed by Greptile |
… the advertised summary
…up is incomplete A GDB console command that reached its deadline while its owned process could not be confirmed stopped returned a capability error without details.diagnostics.session_stop, although the session had recorded command-deadline. Rizin's retained cleanup failure after a timed-out or exited command omitted it the same way. Both now carry the session's stop code, read from the recorded stop (GDB) and the session's stop-reason owner (Rizin). The unreachable second command-deadline assignment in the GDB timer is removed.
5282348 to
c7b36d8
Compare
|
@greptileai please review the latest commit: the branch was rebased on main after #11316 split the guard baselines into per-guard files, and the latest score predates that push. |
Summary
Refs #10508 (Phase 6.1). A stopped GDB or Rizin debug session now states why it stopped as a code, beside the unchanged reason text, so agents and tests do not match the prose.
Problem and expected behavior
closed_reason/details.reasonprose. 13 GDB tests matched that prose.Change and scope
DebuggerSessionStop = {code, reason}; 8 codes:input-stream-failure,output-correlation-failure,command-deadline,command-cancelled,server-shutdown,close-requested,process-exited,stopped.protocolError(and Rizin's retainedstopReason) hold the stop instead of a string;#failProtocoltakes the code. Both managers are changed together because they sharestoppedDebuggerSessionError.docs/reverse-engineering-tools.mdnames the fields and codes.ownedDebuggerSession.tscleanup, not a session stop).Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
DebuggerSessionStop/DEBUGGER_SESSION_STOP_CODES(src/domain/debuggerSessionErrors.ts) owns the reason; each manager'sprotocolErrorand#stopReasonnow produce it at the site that stops the session (#failProtocol(session, code, message), deadline and cancellation paths), andstoppedDebuggerSessionErrorprojects the codegdb_session_statusandrizin_debug_session_statusgain optionalclosed_reason_code; stopped-session and protocol-failure errors gaindetails.diagnostics.session_stop. Reason text unchangeddocs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): two status output schemas gain an optional field;scripts/verify/advertised-schemas/summary.jsondigests updatedExpected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
GdbSessionManagerCoverage.test.ts: 13 prose matches on stop reasons ("REA is shutting down", "close_gdb_session started releasing", stdin stream/write failure, "input stream is closed", "timed out", "MI line exceeding ...",closed_reasontext) now assertdiagnostics.session_stoporclosed_reason_code; injected fake-failure texts stay asserted as carried provenancedetails.reason: "close_gdb_session started releasing this session, ..."anddetails.diagnostics: {"session_stop": "close-requested"}; status reportsclosed_reason_code: "close-requested"For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/boundary/providers/GdbSessionManagerCoverage.test.ts tests/boundary/providers/GdbSessionManagers.test.ts: 219 passed, 1 failed (base: same 219 / 1). Warm wall / CPU (user+sys): before 6.8 / 3.8 s, after 6.6 / 3.5 s.The failing case, "handles a start signal that becomes aborted during listener registration", also fails with base source on this macOS host, so it is not caused by this change.
Same GDB coverage file with the source reverted to base: 14 failed, 192 passed.
npm run test:focused --all 20 GDB/Rizin test files undertests/(including MCP): 410 passed, 10 skipped, 3 failed. The 3 failures (the GDB case above and twoRizinDebugSessionCoverage.part1start/cancellation cases) also fail with base source on this host.npm run test:focused -- tests/boundary/mcp/advertisedDialect.test.ts tests/boundary/mcp/outputSchemaProfile.test.ts tests/boundary/mcp/mcpSchemaValidation.test.ts tests/boundary/mcp/generatedToolCatalog.test.ts: 55 passed.npm run verify:advertised-schemas -- --update-summaryafter rebasing on main:gdb_session_statusandrizin_debug_session_statusoutput digests changed (committed);npm run verify:advertised-schemasthen passed (Rust engines not installed locally).Review follow-up (5282348): both start paths keep the stop code; new case "keeps the stop code on a startup stream failure whose cleanup is incomplete".
npm run test:focused -- tests/boundary/providers/GdbSessionManagerCoverage.test.ts: 206 passed, 1 failed (the base-failing case above).npm run check:fast,npm run docs:check: passed.Rebased on main after refactor(verify): keep each counted guard's baseline in its own file #11316 and the per-tool advertised summaries.
npm run verify:advertised-schemas -- --update-summarychangedscripts/verify/advertised-schemas/tools/gdb_session_status.jsonandrizin_debug_session_status.json(committed in 34ad457). Rust engines are not installed locally.Review follow-up (c7b36d8): a timed-out
gdb_consolecommand whose cleanup is incomplete, and Rizin's retained cleanup failure after a timed-out or exited command, now carrydiagnostics.session_stop.npm run test:focused -- tests/boundary/providers/GdbSessionManagerCoverage.test.ts tests/boundary/providers/RizinDebugSessionCoverage.part4.test.tspassed 226 tests. With the source change reverted, the 2 strengthened cases fail.npm run check:fastpassed.command— resultCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.