Skip to content

fix(ghidra): retain bounded LaunchSupport failure output - #2010

Closed
lyly-bonbon wants to merge 15 commits into
morluto:mainfrom
lyly-bonbon:fix/ghidra-launch-output
Closed

lyly-bonbon wants to merge 15 commits into
morluto:mainfrom
lyly-bonbon:fix/ghidra-launch-output

Conversation

@lyly-bonbon

@lyly-bonbon lyly-bonbon commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Retain the output of failed Ghidra LaunchSupport commands in session diagnostics. -envvars and -vmargs failures already preserve their exit code and nested cause, but stdout is dropped and stderr is only visible inside a message limited to 2 KiB.

Refs #1992.

Problem and expected behavior

A LaunchSupport command that writes diagnostics and exits with code 7 should expose those diagnostics after startup cleanup. Before this change, stdout disappears; a useful reason at the end of a 3 KiB stderr stream is also lost when the error message is truncated.

Wrap the failed command at the LaunchSupport boundary and project its captured streams into failure_cause.cause.command_outcome, with an 8 KiB UTF-8 budget per stream after credential redaction. The original command error remains the wrapper's cause, including its exit code and signal.

Selected fields from the fixture's nested failure cause:

{
  "name": "GhidraLaunchSupportError",
  "command_outcome": {
    "stdout": "LaunchSupport -envvars stdout diagnostic",
    "stdoutTruncated": false,
    "stderrTruncated": false,
    "outputTruncated": false
  },
  "cause": { "code": 7, "signal": null }
}

Change and scope

Parse captured output into a typed GhidraLaunchSupportError at the two LaunchSupport calls. The session projection only exposes command_outcome for that error type, so unrelated failures such as the Swift ownership-helper compiler retain their existing diagnostic representation.

stdoutBytes and stderrBytes measure the captured text before redaction; they do not estimate bytes lost upstream. stdoutTruncated and stderrTruncated describe the projection budget, while outputTruncated records capture truncation. On ABORT_ERR, killed and outputTruncated are null: native execFile cancellation can settle before the child's exit and final stream delivery are observed.

Contract and boundary impact

  • Semantic owner and earliest changed stage: LaunchSupport command failure capture, then Ghidra session-error diagnostics.
  • CLI and MCP/tool-catalog contract: additive diagnostic fields; no tool/schema changes.
  • Provider, bridge, target-format, or platform compatibility: no change to launch behavior or supported targets.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Real fixture subprocesses fail at each LaunchSupport phase. The tests verify complete stdout and stderr beyond the message limit, exit code 7, runtime cleanup, and propagation through the provider, CLI adapter and in-memory SDK MCP transport.
  • Both new boundary cases failed on the base revision because command_outcome was missing, then passed with the change.
  • Caller-cancellation cases for both phases failed on c2c170b3 because unknown termination and capture completeness were reported as false. They pass with nullable fields and verify the fixture exits and its runtime is removed. Cancellation coverage stops at the production client diagnostic boundary; provider cancellation mapping is unchanged.
  • A compiler-error regression failed on c2c170b3 because the nested command outcome duplicated the existing compiler outcome. The typed boundary prevents that duplication.
  • Unit coverage checks credential redaction across the UTF-8 truncation boundary and distinguishes capture truncation from projection truncation.
  • Remaining proof gap: the original macOS x64/JDK/Ghidra failure has not been reproduced. These tests cover the remaining diagnostic-loss branch, not its underlying launch failure.

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

On macOS arm64 with Node 24.18.0 and npm 11.16.0:

  • npm run test:focused -- src/ghidra/GhidraSessionError.test.ts tests/boundary/mcp/ghidraFailureDiagnostics.test.ts src/ghidra/GhidraRequestQueue.test.ts tests/boundary/providers/ghidra/ghidraClient.test.ts tests/boundary/providers/ghidra/ghidraLauncher.test.ts — 70 passed, 1 Windows-only test skipped.
  • npm run check — passed, including typecheck, lint, formatting, unused-code checks, metadata and architecture guards. Lint reports warnings but no errors.
  • git diff --check — passed.
  • node scripts/verify-real-ghidra.mjs — could not run: GHIDRA_INSTALL_DIR is unset and this host has no configured Ghidra/JDK installation.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: fixture subprocesses on macOS arm64; real Ghidra and native Windows/Linux not verified.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: output uses the existing credential redactor before bounded projection. No arbitrary error properties, environment or stack traces are added.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T18:47:00.727960Z 738e6e1 New commits
ℹ️ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2c170b3cc

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ghidra/GhidraSessionError.ts Resolved
Comment thread src/ghidra/GhidraSessionError.ts Resolved
@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: On Linux with real Ghidra 12.1.4, a failed LaunchSupport keeps its stderr and stdout in the JSON, as described. The newest commit puts the exit code and signal one level deeper, under a layer that names the failed phase. One gap remains: REA hides only its own session token, so any other secret in the output stays visible.

Results

Base is edf4624. Head is 90cda4e, which sits on top of c2c170b. I tested it as base plus the PR's four changed files. All four are unchanged between the PR's parent and base, so this equals a merge onto base. GitHub's own merge ref now targets a newer main, 42b0ed1, so I did not use it. Real-world runs used Node 24.18.0 only.

Check Node 22.23.1 Node 24.18.0 Node 26.11.1
Typecheck, base not run pass not run
Typecheck, head not run pass not run
Five Ghidra test files, base not run 64 passed, 1 skipped not run
Five Ghidra test files, head not run 70 passed, 1 skipped not run
The PR's two test files, head 10 passed 10 passed 10 passed
The PR's two test files run on base code not run 6 of 10 failed not run
Real failure, launch.properties removed, base not run reason kept in the message (383 bytes of stderr) not run
Same real failure, head not run same reason, plus command_outcome with the same stderr not run
Stand-in jar, 3,092 bytes of stderr, base not run reason lost, message cut at 2 KiB not run
Stand-in jar, 3,092 bytes of stderr, head not run reason kept, no cut flag set not run
Same stand-in, failing in -vmargs, head not run reason kept; the layer names -vmargs not run
Stand-in jar, 20,585 bytes of stderr, head not run stderrTruncated: true, 8,192 bytes kept not run
Session token echoed to stderr, head not run shown as [REDACTED] not run
Another secret echoed to stderr, head not run not redacted not run

Six tests failed on base. They are the new ones: two unit cases, the -envvars and -vmargs boundary cases, and two cancellation cases.

The key repro. A stand-in LaunchSupport prints 3 KiB to stderr and exits 7. The reason is on the last line.

base: failure_cause.cause is the command error: code 7, message_truncated true,
      no command_outcome, "REASON:" not in the JSON
head: failure_cause.cause is GhidraLaunchSupportError, "Ghidra LaunchSupport -envvars failed"
        command_outcome: stdout "STUB-STDOUT-MARKER -envvars", stderrBytes 3092,
          stderrTruncated false, outputTruncated false, killed false
          stderr ends "REASON: stub LaunchSupport failed in -envvars because the stub said so"
        cause: the command error, code 7, signal null, message_truncated true

On head, the exit code and signal are still there. They moved from cause to cause.cause. A reader that looks for failure_cause.cause.code finds nothing on head.

Not run

  • The original macOS x64 failure, and native Windows or macOS.
  • outputTruncated: true. The launch path sets no maxBuffer, so I read the code and expect it to stay false. I did not make it true.
  • killed: true, and the new cancel case where killed and outputTruncated are null. Only the PR's unit and boundary tests cover those, and they passed.
  • A JDK that is too old, as a LaunchSupport failure.
  • A bad JAVA_HOME on this commit. On c2c170b, base and head gave the same output. REA turns it down before LaunchSupport starts.
  • The MCP route on real Ghidra. Only the CLI ran. The PR's own boundary test covers MCP.
  • npm run check, which includes lint and formatting.
  • Real-world runs on Node 22 and 26.

Thanks, lyly-bonbon, for the PR.

Changes since the earlier head

I ran this PR twice. The first head was c2c170b. The second is 90cda4e.

  • Changed: the five-file run went from 68 to 70 passed. The PR's two files went from 8 to 10 passed. The tests on base code went from 4 of 8 failed to 6 of 10 failed. The new commit added the tests.
  • Changed: the JSON shape. A new layer, GhidraLaunchSupportError, holds command_outcome. Its message names the phase, such as Ghidra LaunchSupport -envvars failed. The exit code, signal and original message sit one level down, in its cause. On c2c170b, command_outcome sat on the command error beside the exit code.
  • Same: the text of stdout and stderr, the byte counts, every flag, and the 8 KiB cut. The 3 KiB and 20 KiB results match c2c170b.
  • Same: redaction. The session token is hidden. The made-up API_TOKEN is shown in full.
  • Same: the real failure with launch.properties removed. Base already kept the stack trace in its message, because the stderr is only 383 bytes. Head adds the same text as separate fields.
What each case showed

Real failure, short output. I used the real LaunchSupport.jar with launch.properties removed. Base already kept the Java stack trace in the error message. Head adds the same text as separate stdout and stderr fields. The gain shows up when output is long, or when stdout holds the reason.

Truncation. At 20,585 bytes, head kept the first 8,192 bytes of stderr. The reason on the last line was cut. stderrBytes shows how much was lost. Real JVM errors are short, so this may never matter.

Redaction. The redactor knows one thing: the random session token REA makes for each run. The stand-in jar read that token from the session file and printed it. Head showed [REDACTED]. The stand-in also printed a made-up API_TOKEN=fake-api-token-value-9f3c1a, and head showed it in full. Base lost that line only because the message was cut. I did not check whether real LaunchSupport ever prints secrets. Only the stand-in did.

Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 22.23.1, 24.18.0, 26.11.1
  • Head: 90cda4e
  • Base: edf4624
  • Trees: head was base plus the PR's four files from 90cda4e.
  • Ghidra: 12.1.4 (Apache-2.0)
  • JDK: Temurin 21.0.12.1+1 (GPL-2.0-only WITH Classpath-exception-2.0, from the JDK's own license file)
  • Ghidra ran from a scratch folder. The support folder was a copy and the other folders were links to the real install. The real install was not changed.
  • The stand-in jar is a small Java class named LaunchSupport. The real JDK 21 ran it through REA's real launch path. It replaced LaunchSupport.jar in the scratch copy only.
  • Target: a 12 KB C program built with gcc. Command: rea analyze <program> --provider ghidra --json.
  • No other test of mine ran at the same time.
Commands
# build and typecheck, each tree (Node 24, under a memory cap)
npm ci && npm run build && npm run test:prepare
npm run typecheck
npm run test:focused -- src/ghidra/GhidraSessionError.test.ts \
  tests/boundary/mcp/ghidraFailureDiagnostics.test.ts \
  src/ghidra/GhidraRequestQueue.test.ts \
  tests/boundary/providers/ghidra/ghidraClient.test.ts \
  tests/boundary/providers/ghidra/ghidraLauncher.test.ts

# the PR's two files on Node 22 and 26 (head only)
npm run test:focused -- src/ghidra/GhidraSessionError.test.ts \
  tests/boundary/mcp/ghidraFailureDiagnostics.test.ts

# real-world run, per tree and per case
GHIDRA_INSTALL_DIR=<scratch copy> JAVA_HOME=<JDK 21> \
  node scripts/rea.mjs analyze <program> --provider ghidra --json

Cases:

  • Remove launch.properties from the scratch copy.
  • Swap in the stand-in jar. It fails in -envvars or -vmargs. It prints 3 KiB or 20 KiB of stderr. One run also echoes the session token and a made-up API_TOKEN.

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

Copy link
Copy Markdown
Contributor Author

@morluto Could you approve the CI run for this PR? It is still awaiting maintainer approval.

Thanks to CassieFox23 for the Linux testing. Could you confirm how you would like to handle these two points from that feedback before merging?

  1. Redaction: the existing redactor covers REA's session token, but the test fixture showed that other secrets in command output remain visible. Should broader redaction be included in this PR, or handled in a follow-up?
  2. Diagnostic compatibility: the GhidraLaunchSupportError wrapper preserves the original error as its cause, moving the exit code and signal from failure_cause.cause.code / .signal to failure_cause.cause.cause.code / .signal. Should this PR preserve access at the previous level, or is the nested representation acceptable?

The two earlier inline findings were addressed in 90cda4e, and both threads are resolved. I can adjust this PR based on your preferred approach.

@dandgabr dandgabr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review corrections

  • P3 — Bound LaunchSupport output before redaction. ghidraJavaLaunch() calls execFileOutput() without a maxBuffer, whose default capture is unbounded. On a LaunchSupport failure, GhidraSessionError now passes the complete captured stdout and stderr through the redactor before applying the 8 KiB diagnostic projection limit. A failing or compromised local helper can therefore retain arbitrarily large output and trigger unbounded redaction work during startup failure. Set an explicit capture ceiling at the command boundary and preserve whether capture was truncated.

@lyly-bonbon

Copy link
Copy Markdown
Contributor Author

Regarding the capture-limit review: confirmed from the source that LaunchSupport has no capture ceiling. The 8 KiB bound applies only to projected diagnostics; it does not bound capture or redaction work.

A capture limit also affects successful -envvars and -vmargs responses, so it needs an explicit overflow policy and regression coverage. Simply slicing before redaction can leave a session-token prefix unredacted at the cutoff.

#2011 has now merged for #1992 and retains the same unbounded capture path. This PR conflicts with that alternative implementation. I am leaving this concern pending until the remaining scope is settled, rather than adding a capture policy to the overlapping implementation.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Refactors error handling and output redaction for Ghidra launch diagnostics.

Fix the previously reported overlap-test assertion before merging.

Findings

  1. P1 Overlap test expects extra marker ▶
Fix with agent prompt
### Issue 1
src/process/ProviderDiagnosticRedaction.test.ts:undefined-36
This assertion expects two `[REDACTED]` markers, but `redactCapturedTransportCredentials` returns one. The fixture gives `suffixLength` 63 and `cutoff` 63. The complete token overlaps that cutoff, so the function moves `cutoff` to 0 and returns only the trailing replacement.

Both secrets are hidden, but this assertion fails and blocks the test suite. Expect one marker for the merged secret range.

```suggestion
  ).toBe("[REDACTED]");
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR keeps failed Ghidra LaunchSupport output in session diagnostics.

  • Failed LaunchSupport commands keep their output in session errors.

Source review found no new actionable issue. Tests were not run during this review. Whether another PR supersedes this one could not be checked because GitHub access was unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["LaunchSupport -envvars or -vmargs fails"] --> B["GhidraLaunchSupportError retains captured output"]
  B --> C["GhidraLaunchError preserves the cause"]
  C --> D["Startup cleanup"]
  D --> E["Session diagnostics redact and bound each stream"]
  E --> F["Nested command_outcome"]
  F --> G["Provider, CLI and MCP error output"]
Loading

Reviews (10) · Last reviewed commit: "Merge branch 'main' into fix/ghidra-laun..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffd5f4119e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ghidra/GhidraSessionError.ts Resolved
Comment thread src/ghidra/GhidraJavaLaunch.ts Resolved
Comment thread src/ghidra/GhidraLauncher.ts Resolved
Comment thread src/ghidra/GhidraSessionError.ts Resolved
Node timers can fire while performance.now() is still a fraction of a
millisecond short of the monotonic deadline. ProviderStartupDeadline then
reported interruption "timeout" and an aborted signal while remainingMs()
returned ceil(0.x) = 1, so polling loops guarded by remainingMs() > 0
(Hopper and Ghidra startup) could run past an elapsed deadline, and the
real-timer test "aborts a bounded wait when its real monotonic deadline
expires" failed intermittently in CI (expected 1 to be 0).

Once the deadline's own timer has classified a timeout, report zero
remaining time. A deterministic regression test fires the timer with the
monotonic clock 0.4 ms short of the deadline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d16e6ae56

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ghidra/GhidraClient.ts Resolved
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open.

  1. thread 1

Fixed in 4d16e6a.

Root cause: Session failure redaction received plain strings without capture completeness, so it removed complete tokens but could retain a credential prefix when maxBuffer cut the other pipe.

Structural fix: Capture completeness now reaches the client-owned authentication redactor. It delegates to the existing truncation-aware credential redactor for both streams before output bounds; unknown abort completeness is conservative too. Bounded successful helper warnings preserve their truncation fact.

Source validation: Added a source regression carrying a cut token prefix through session failure projection; inspected the production client callback, command/launch projection, and credential redactor. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted.

Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision.

  1. thread 1

Fixed in 4d16e6a.

Root cause: The shared execFile failure extractor treated Node’s missing killed property as false even for the maxBuffer path, which terminates the process.

Structural fix: The shared execution boundary now normalizes ERR_CHILD_PROCESS_STDIO_MAXBUFFER to killed:true. LaunchSupport preserves that owner fact; ABORT_ERR still keeps final termination/completeness explicitly unknown.

Source validation: Updated the maxBuffer diagnostic regression to omit the killed property and still require killed:true; inspected both shared extractor and helper/launch consumers. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted.

Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision.

  1. thread 1

Fixed in 4d16e6a.

Root cause: The merged launch envelope and helper-specific nested envelope serialized the same captured streams independently.

Structural fix: The existing launch_outcome now owns the streams plus code, killed, and capture-truncation metadata. Nested helper causes retain error identity/code/signal but omit the duplicate command_outcome when the outer launch already owns it. Standalone/abort helper failures keep their meaningful envelope.

Source validation: Added a single-output/redaction regression and updated the overflow boundary assertion to the single launch outcome; inspected the existing launch-failure contract and cause recursion. Targeted formatting used pinned Node 24.18.0 with two threads; git diff --check passed. Tests, typechecks, lint, builds, provider workloads, and CI reruns were intentionally not executed at the user’s request. Authored regressions remain unexecuted.

Remaining cleanup: no directly related source cleanup identified in this bounded pass. Runtime/provider behavior remains unverified by this revision.

@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: cli CLI adapter and one-shot commands area: runtime Process capture and runtime observation P2: medium Medium priority issue labels Oct 13, 2026
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open.

review thread

Fixed publicly in 32be546. Credential redaction selected the suffix from only the initial retained tokens before mutation, so an authentication value crossing token boundaries could leave a suffix visible. Suffix selection now spans the retained token set before mutation. Producer/consumer inspection covered LaunchSupport output retention and the redaction boundary; diff whitespace review passed. Tests, builds, lint, typechecks, provider workloads, CI reruns, and real Ghidra verification were not run at the explicit user request. No directly related source cleanup remains.

dakjdakd and others added 2 commits October 14, 2026 01:05
* fix(comparison): preserve incomplete function call evidence

Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty.

Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls.

* fix(comparison): recheck historical calls-only changes

---------

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8cd3edb8fe

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +42 to +45
let redacted =
suffixLength === 0 ? text : text.slice(0, text.length - suffixLength);
for (const token of credentials)
redacted = redacted.replaceAll(token, replacement);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Redact overlapping full tokens before slicing the suffix

When an incomplete diagnostic contains a complete retained token that overlaps the selected credential-prefix suffix—for example, an old 64-hex token ending in c followed by characters 2–63 of a current token beginning in c—the computed 63-character suffix starts at the old token's last character. Slicing here therefore removes that last character before replaceAll runs and returns the other 63 characters of the old bearer token in the newly exposed Ghidra command output. Fresh evidence after the earlier retained-token report is that this revision now chooses the suffix globally but still performs complete-token replacement only after the destructive slice; redact matches on the original text, including intervals crossing the suffix boundary, before emitting it.

AGENTS.md reference: AGENTS.md:L13-L13

Useful? React with 👍 / 👎.

[previous, current],
"[REDACTED]",
),
).toBe("[REDACTED][REDACTED]");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Overlap test expects extra marker

This assertion expects two [REDACTED] markers, but redactCapturedTransportCredentials returns one. The fixture gives suffixLength 63 and cutoff 63. The complete token overlaps that cutoff, so the function moves cutoff to 0 and returns only the trailing replacement.

Both secrets are hidden, but this assertion fails and blocks the test suite. Expect one marker for the merged secret range.

Suggested change
).toBe("[REDACTED][REDACTED]");
).toBe("[REDACTED]");
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/process/ProviderDiagnosticRedaction.test.ts
Line: 36

Comment:
**Overlap test expects extra marker**

This assertion expects two `[REDACTED]` markers, but `redactCapturedTransportCredentials` returns one. The fixture gives `suffixLength` 63 and `cutoff` 63. The complete token overlaps that cutoff, so the function moves `cutoff` to 0 and returns only the trailing replacement.

Both secrets are hidden, but this assertion fails and blocks the test suite. Expect one marker for the merged secret range.

```suggestion
  ).toBe("[REDACTED]");
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb8caea124

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

...(options.signal === undefined ? {} : { signal: options.signal }),
});
} catch (cause: unknown) {
throw new GhidraLaunchSupportError(phase, cause);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve abort reasons through the helper wrapper

When a caller aborts GhidraClient.start() with an explicit reason while -envvars or -vmargs is running, this extra wrapper changes the projected chain to AnalysisCancelledError -> GhidraLaunchError -> GhidraLaunchSupportError -> AbortError. describeCause starts at the cancellation error and, with MAX_CAUSE_DEPTH = 3, reaches the native AbortError at depth 3, so its cause (where Node preserves signal.reason) is replaced by cause_truncated; before this wrapper the supplied reason was still projected. Flatten the helper outcome or otherwise preserve the abort reason without consuming another cause level so CLI/MCP diagnostics do not drop caller-selected cancellation evidence.

AGENTS.md reference: AGENTS.md:L29-L29

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@morluto morluto closed this in d4bd65c Oct 14, 2026
@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks @lyly-bonbon for making LaunchSupport failures diagnosable instead of losing the JVM's output. Main now captures bounded helper output and carries the failed phase and command outcome through Ghidra error projection (main).

@morluto morluto added the provider: ghidra Analysis provider / engine: ghidra label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: runtime Process capture and runtime observation bug Something isn't working P2: medium Medium priority issue provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants