Repository navigation
fix(ghidra): name the startup deadline setting when startup times out - #4590
Conversation
Codex Review SummaryThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryGhidra startup timeout errors now name the applied deadline and the settings users can change.
Reviews (1) · Last reviewed commit: "fix(ghidra): name the startup deadline s..." · Reviewed by Greptile |
|
Additional Windows evidence supporting this startup-deadline guidance. Environment: Windows 11 x64, REA npm 6.5.0, Ghidra 12.1.4, JDK 21.0.12.1, Node 24.14.1. The input was a locally installed 13,933,176-byte PE32 x86 executable (SHA-256 Using fresh standalone SDK MCP sessions, the sequence was
A separate attempt through the existing Codex connection had hit its client-side 300-second deadline before REA's default startup deadline. This reinforces the need to explain both settings. For this input, the observed timeout was insufficient cold-start allowance rather than a persistent hang. A smaller function query would still trigger the same full import/auto-analysis startup. The proposed guidance to name the startup setting and distinguish the MCP client's deadline addresses the actual recovery path. Coverage limitation: this verifies the existing timeout override and successful Windows Ghidra lifecycle on the released package. I have not run this PR branch's changed message rendering on Windows. These are individual reproduction timings, not a controlled performance benchmark. |
|
Thanks @RishTheFish21 for making Ghidra startup timeouts explain which deadline actually elapsed. Naming |
Summary
When Ghidra doesn't finish importing and analyzing a target within its startup deadline, REA reports
provider_timeoutwith the generic "Analysis took too long. Try a smaller request, then runrea doctorif it continues." For a large binary that's the wrong advice: the request isn't too big, the deadline is too short, andrea doctorreports Ghidra as healthy. The setting that controls it,REA_GHIDRA_STARTUP_TIMEOUT_MS, is only mentioned indocs/installation.md.A Ghidra startup timeout now names the deadline that was applied and the settings that change it.
Fixes #4241. The memory half of the issue landed in d52a488 (from #4275). This PR covers its second request. The optional third idea, surfacing analyzer messages like "Untested Go version" as limitations, isn't included.
Problem and expected behavior
Smallest trigger:
REA_GHIDRA_STARTUP_TIMEOUT_MS=5000 rea inspect "$(command -v node)" --provider ghidra --json.Expected: the error says which deadline elapsed and how to change it, without sending the user to
rea doctor. A timeout on an individual bridge request is a different deadline and should keep its current wording.Hopper already does this: its startup timeout remediation names
REA_HOPPER_STARTUP_TIMEOUT_MS. Ghidra's equivalent setting is never mentioned in its timeout error.Change and scope
GhidraProviderClient.ts: atimeoutfailure carrying the startup-deadline message now gets a user message naming the applied deadline andREA_GHIDRA_STARTUP_TIMEOUT_MS, plus remediation to raise it or skip expensive analyzers withREA_GHIDRA_DISABLED_ANALYZERS. The remediation also notes that the MCP client's own tool-call timeout is separate.GhidraSessionError.ts: the five places that raise the startup timeout (GhidraClient,GhidraClientStartup, and two inGhidraSocketConnection) share oneGHIDRA_STARTUP_DEADLINE_ELAPSEDconstant, so the projection can't drift from them.AnalysisTimeoutErroraccepts an optional provider-specificuserMessageandremediationAction, and the error presentation uses them when present. Every other timeout keeps its current text.docs/installation.md: notes the new guidance next to theREA_GHIDRA_STARTUP_TIMEOUT_MSdescription.Bridge request deadlines and the per-file auto-analysis deadline (
analysis_timeout) are unchanged.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
projectPrimarySessionError); provider-neutralAnalysisTimeoutErrorpresentation.provider_timeoutcode anddetails.timeout_ms. Only the message andremediation.actiontext change, and only for Ghidra startup timeouts.docs/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): 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
src/ghidra/GhidraProvider.behavior.test.ts, "Ghidra deadline guidance":provider_timeoutwithtimeout_ms: 250, a message naming the 250 ms deadline andREA_GHIDRA_STARTUP_TIMEOUT_MS, and remediation naming both settings withoutrea doctor.REA_GHIDRA_STARTUP_TIMEOUT_MS=5000 rea inspect "$(command -v node)" --provider ghidra --json:"code":"provider_timeout", message and action bothAnalysis took too long. Try a smaller request, then run \rea doctor` if it continues.`"code":"provider_timeout", messageGhidra did not finish importing and analyzing the target within its 5000 ms startup deadline (REA_GHIDRA_STARTUP_TIMEOUT_MS)., actionLarge binaries can need longer: set REA_GHIDRA_STARTUP_TIMEOUT_MS above 5000 in the environment that starts REA, or skip expensive analyzers with REA_GHIDRA_DISABLED_ANALYZERS, then open the target again. An MCP client's own tool-call timeout is separate and may also need raising.For evidence-bearing changes:
Validation performed
npm run test:focused -- src/ghidra/GhidraProvider.behavior.test.ts tests/boundary/providers/ghidra/ghidraJavaLaunch.test.ts: passednpm run check:fast: passednpm run lint: passednpm run knip: passednpm run docs:check: passedCompatibility, safety, and release
Author readiness
Human owner: @RishTheFish21
Before merge
type(scope): outcome.