Skip to content

feat(gdb): name why close requires an explicit inferior disposition - #11652

Merged
morluto merged 1 commit into
mainfrom
feat/gdb-close-disposition-reason
Nov 16, 2026
Merged

morluto merged 1 commit into
mainfrom
feat/gdb-close-disposition-reason

Conversation

@morluto

@morluto morluto commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Summary

Refs #10508 (last item: the pre-cleanup close refusal prose). When close_gdb_session refuses to detach automatically, the reason was only in prose ("Multiple live GDB inferiors require an explicit disposition…" vs "…no durable inferior TTY is verified"). The refusal now carries the reason and the live inferior count as typed diagnostics.

Problem and expected behavior

Before: a caller (or test) could tell the two refusal causes apart only by reading message.

After: details.diagnostics = { inferior_disposition_required: "multiple-inferiors" | "no-durable-output-sink", live_inferiors: N }. The values are the existing DebuggerCleanupIncompleteCodes that a forced stop reports for the same conditions, checked with satisfies.

Change and scope

  • src/gdb/GdbSessionManager.ts: the refusal passes diagnostics; the message, userMessage, remediation and retryable: true are unchanged.
  • tests/boundary/providers/GdbSessionManagerCoverage.test.ts: both cases (single inferior without a verified TTY, two inferiors) assert the typed reason and count on the error and on the projection.

Not included: other debugger providers (Rizin, LLDB) have no equivalent pre-cleanup refusal.

Contribution scope: within existing boundaries.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the GDB session manager's close path.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: additive details.diagnostics on this capability_unavailable refusal.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Both test cases fail with main's GdbSessionManager.ts (no diagnostics) and pass with the change.
  • Remaining proof gaps: no real GDB run; the cases use the fake MI spawner.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/boundary/providers/GdbSessionManagerCoverage.test.ts: 207 passed; with main's manager, 2 failed.
  • npm run check:fast: passed. npx oxfmt on the changed files.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: fake GDB MI only; macOS.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

The pre-cleanup close refusal carries diagnostics.inferior_disposition_required (multiple-inferiors or no-durable-output-sink, the cleanup codes a forced stop would report) and live_inferiors, so callers and tests need not read its prose.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T01:55:12.874642Z
We couldn’t complete this review. Comment @codex review to try again.
46a0811 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Low impact] This PR appears safe to merge; it adds refusal details without changing cleanup decisions.

Summary

Adds a machine-readable reason and live inferior count when close_gdb_session requires an explicit choice about attached processes.

  • GDB close refusals now include the reason and live inferior count.

Reviews (1) · Last reviewed commit: "feat(gdb): name why close requires an ex..." · Reviewed by Greptile

@morluto
morluto merged commit 162097b into main Nov 16, 2026
7 checks passed
@morluto
morluto deleted the feat/gdb-close-disposition-reason branch November 16, 2026 02:00
@morluto morluto added enhancement New feature or request provider: gdb Analysis provider / engine: gdb labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request provider: gdb Analysis provider / engine: gdb

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant