Repository navigation
fix(providers): name JEB, IDA, and one-shot command deadlines - #6014
Conversation
Wire JEB catalog discovery to REA_JEB_MCP_TIMEOUT_MS, name the IDA registration timeoutMs, and add command_timeout_ms for one-shot objdump and rizin. Debugger, Frida, and Cutter caps stay fixed and say so. Refs #5910 Co-authored-by: morluto <morluto@users.noreply.github.com>
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 018b64edf9
ℹ️ 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".
[Medium impact] The PR appears safe to merge; no outstanding defect was established. SummaryNames provider deadlines and adds caller-selected timeouts for one-shot objdump and rizin commands.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["Selected command_timeout_ms or 120000"] --> B["Preflight: stat and hash share one budget"]
B --> C["One-shot command gets a fresh budget"]
C --> D["Post-run stat and hash share another fresh budget"]
Reviews (3) · Last reviewed commit: "fix(frida): preserve non-timeout device ..." · Reviewed by Greptile |
Resolve the provider startup timeout conflict by adopting MAX_PROVIDER_STARTUP_TIMEOUT_MS from main and pointing JEB deadline guidance at that ceiling. Keep the JEB catalog-deadline note in the MCP contract docs. Co-authored-by: morluto <morluto@users.noreply.github.com>
Catalog discovery now sends the JEB budget still remaining to the SDK on connect and every tools/list page. Objdump and rizin preflight share one command_timeout_ms across stat and digest; the command still receives that budget again. Architecture Evidence keeps a selected timeout, and Frida and Rizin name the capture limit that actually stopped output. Co-authored-by: morluto <morluto@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 946c011a17
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
getDeviceById is a lookup deadline only when Frida rejects with "Device not found" after the wait. A device-manager or backend failure stays a capability error. Align the assertions that still expected the previous capacity and capture sentences. Co-authored-by: morluto <morluto@users.noreply.github.com>
Summary
Names the deadlines in the #5910 provider-timeout theme and makes the shared one-shot objdump/rizin clock adjustable. Does not repeat the MCP response-budget work in #6005. Refs #5910 (parent #5808).
Merged
main(d8a9673fc). The only conflict wassrc/config/providerStartupTimeout.ts: this branch keeps main's exportedMAX_PROVIDER_STARTUP_TIMEOUT_MS, and JEB remediation uses that name.docs/mcp-contracts.mdauto-merged, keeping both the swiftc restart sentence and the JEB discovery sentence.Problem and expected behavior
JEB
tools/calltimeouts did not nameREA_JEB_MCP_TIMEOUT_MS, and catalog discovery ignored that setting while the docs said the tools/call budget does not extend discovery. A later pass still left the SDK request timeout at its 60000 ms default whenever the configured discovery budget was larger. IDA request timeouts did not name registrationtimeoutMs. One-shot objdump and rizin used a fixed 120000 ms deadline with no caller control, and the production command runner ignored a passed timeout. Preflight also restarted that clock afterstat, so digest could spend the full budget again. Architecture Evidence dropped a selected timeout when there was no artifact path. gdb, Rizin debug, Frida, and Cutter caps in this theme failed without saying they have no override, and some sentences named a cap that had not fired.A timeout now names the effective milliseconds, the control when one exists, the accepted range, and when a change applies. Raising
REA_JEB_MCP_TIMEOUT_MSraises catalog discovery and eachtools/calltogether, and discovery passes the time still remaining as the SDK timeout on connect and everytools/listpage.command_timeout_ms(CLI--command-timeout-ms) changes the next one-shot objdump or rizin call. Omitted still means 120000 ms. Target preflight shares one budget across stat and digest. The one-shot command receives that budget again. The post-run digest starts another full budget and shares stat and hash inside that call.Change and scope
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.
Not applicable. This names and wires existing analysis deadlines and adds one caller-selected timeout on commands REA already runs. It does not add a provider, injection, mutation, or protection recovery.
Named, existing controls:
REA_JEB_MCP_TIMEOUT_MS, integer 1..2147483647. Omitted means the pinned MCP SDK default of 60000 ms. Restart and reconnect to apply. The same parsed value is passed asdiscoveryTimeoutMsandrequestTimeoutMs. Connect and eachtools/listpage passdeadline.remainingMs()as the SDK request timeout, so a configured value above 60000 ms is not replaced by the SDK default. It is still not one end-to-end deadline: discovery and eachtools/calleach start their own budget.timeoutMsin the file named byREA_IDA_MCP_CONFIG(verified insrc/ida/IdaConfiguration.ts). Integer 1..2147483647. Omitted means 300000. The file is re-read when the next IDA connection is created; an open session keeps the timeout it connected with. Changing the env path itself is process start. A shorter inner request is the time remaining inside that ceiling, and the error names both when they differ. Readiness-while-busy uses the same key.Newly adjustable:
command_timeout_msoninspect_with_objdump(includingarchitectures) andexecute_rizin_command. Default 120000, range 1..2147483647, next call, no restart. Target preflight shares one budget across stat and digest. The one-shot command receives that budget again. The post-run digest starts another full budget and shares stat and hash inside that call. It does not raise the 16 MiB combined output cap, Ghidra or Hopper startup, or a debugger session deadline. The production runner now usesoptions.timeoutinstead of ignoring it. The omitted path stays 120000 ms. A selected value is kept on architecture Evidence; omission leaves the key absent.Left fixed, with “no runtime override” on the agent-visible failure or limitation:
getDeviceByIdwait of 1000 ms. Frida Core 17.23.2 rejects that wait withDevice not found, and only that rejection is reported as the deadline. A device-manager or backend failure, such asDevice manager is closed, stays a capability failure with its own message and is not reported as the deadline. Remote devices do not use the lookup.messages_truncatedmeans the session capture budget dropped data. Field truncation names its own cap and does not set that flag. Flags inside a callerpayloadare ignored. The sentences live insrc/frida/fridaCaptureLimits.ts.command_timeout_msdoes not raise it.Ghidra 330000 (
REA_GHIDRA_STARTUP_TIMEOUT_MS), Hopper 120000 (REA_HOPPER_STARTUP_TIMEOUT_MS), and Kuna project/function timeouts already name their controls. They are unchanged. Out of scope: MCP response budget (#6005), JavaScript heap, Android/JADX, browser, native, swiftc, engines, and ASAR.Contract and boundary impact
REA_JEB_MCP_TIMEOUT_MSand passes it to both connection phases. The connection owner applies the remaining discovery budget to the SDK handshake and each catalog page. IDA configuration ownstimeoutMsguidance.src/domain/reverseEngineering.tsownscommand_timeout_ms;ReverseEngineeringServiceapplies one budget across preflight stat and digest, then again to the command. Debugger, Frida, and Cutter providers own their fixed-cap sentences. Frida capture-cap wording is owned bysrc/frida/fridaCaptureLimits.ts. Frida device lookup classifies the provider rejection inFridaInstrumentationManager.#selectDevice;providerErrorstill maps a non-timeout cause to a capability failure.command_timeout_ms/--command-timeout-mson one-shot objdump, architecture listing, and one-shot rizin. Omitted input stays valid. Tool descriptions name the default, range, and what it does not raise.rizin_debug_commandsays Evidence names the output-byte, frame-byte, or frame-count cap. Generated catalogs are ignored outputs and were not committed.REA_JEB_MCP_TIMEOUT_MSinstead of staying at 60000 ms, including on the SDK request timeout. IDA, Ghidra, Hopper, and Kuna numbers are unchanged.command_timeout_msis recorded on one-shot Evidence parameters, including architecture listing. Omission leaves the key absent. Timeout Evidence and limitations name the effective deadline or the capture cap that fired.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 committed. The packaged skill does not document these deadlines.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Existing objdump, rizin, debugger, Frida, and Cutter operations already perform their target interactions. This PR changes deadline selection and recovery text. It does not add a new interaction.
Evidence and regression coverage
src/jeb/JebMcpConnection.test.ts(discovery budget of 120000 ms on connect and every catalog page),tests/boundary/providers/jebMcpTimeout.test.ts,src/ida/IdaMcpConnection.test.ts,src/ida/IdaBusyHealth.test.ts,tests/composition/reverseEngineering.test.ts(shared preflight clock, architecture Evidence,runOwnedlimits.timeoutMs),tests/boundary/cli/reverseEngineeringCommands.test.ts,src/application/frida/FridaInstrumentationManager.test.ts(Device not foundis the 1000 ms deadline;Device manager is closedstays a capability failure),src/application/frida/FridaInstrumentationService.test.ts,tests/boundary/mcp/fridaLifecycleMcp.test.ts(field truncation does not setmessages_truncated),tests/composition/reverseEngineeringEdgeCases.test.ts(admission sentence includes the operation count),tests/boundary/providers/GdbSessionManagerCoverage.test.ts(named MI record cap),tests/boundary/providers/RizinTimeoutEvidence.test.ts,tests/boundary/providers/RizinDebugSessionCoverage.part4.test.ts,tests/boundary/providers/RizinDebugSessionCoverage.part5.test.ts(4096 frame sentence).tools/listpreviously passed onlysignal, so@modelcontextprotocol/client2.3.1 keptDEFAULT_REQUEST_TIMEOUT_MSEC60000.digestFilestarted the hash timer only after stat returned.#observeProviderreplaced architecture parameters with{ operation: "architectures" }.runOwnedCommandOutputmapsoptions.timeouttolimits.timeoutMs; a test that replacesrunnever reaches that adapter. Frida field truncation setmessages_truncated. Rizin frame-count truncation reused the byte-cap sentence.#selectDeviceturned everygetDeviceByIdrejection intoAnalysisTimeoutError. Installed Frida 17.23.2 on this machine:getDeviceByIdfor a missing id with a 50 ms timeout rejected after about 50 ms with messageDevice not found; the same call afterclose()rejected immediately withDevice manager is closed.catalog discoveryand100 ms, and the remediation namesREA_JEB_MCP_TIMEOUT_MS,2147483647,60000, and restart. A tools/call timeout saystools/call. An IDA request of 40 ms inside a 1000 ms ceiling names both andREA_IDA_MCP_CONFIG. A one-shot rizin timeout with no field sayscommand_timeout_msand120000 msand omits the key from parameters.command_timeout_ms: 5000is the error timeout, is passed to the command runner, and is recorded on parameters, including architecture Evidence.0and2147483648areAnalysisInputError. A 4096-frame Rizin capture says4096 frame command limitand does not claim16777216. Frida type truncation names4096and does not setmessages_truncated. A FridaDevice not foundlookup projectsprovider_timeoutat 1000 ms.Device manager is closedprojectscapability_unavailableand does not saydeadlineExpired.946c011afailed in Source tests, Test shard (5/8), Reverse tools quality, Portable tests, and CI required for the three stale assertions fixed here. Those jobs have not been re-run on this commit yet. Ghidra, Hopper, and Kuna paths were not re-executed because those files were not changed by the review fixes.For evidence-bearing changes:
Validation performed
On
b0eca9fb:npx oxfmt --writeon the five edited files — completed.npm run check:fast— typecheck and lint succeeded (2 tasks).npm run test:focused -- src/application/frida/FridaInstrumentationManager.test.ts tests/boundary/mcp/fridaLifecycleMcp.test.ts tests/composition/reverseEngineeringEdgeCases.test.ts tests/boundary/providers/GdbSessionManagerCoverage.test.ts— 4 files, 312 tests passed.On
946c011a, not repeated after this commit: focused JEB, IDA was not re-run then either, rizin coverage,tests/composition/reverseEngineering.test.ts(27 tests), andnpm run test:local -- src/jeb/JebMcpConnection.test.ts(13 tests). Real provider workflows were not run. The JEB tests use the repository HTTP fixture and spy on the installed MCP client. The preflight regression uses an injected stat and a stream that never ends; it does not open a FIFO.Compatibility, safety, and release
REA_JEB_MCP_TIMEOUT_MSnow also change catalog discovery, including the SDK request timeout; previously that setting did not. A slow preflight stat now consumes the same budget as the digest instead of granting the hash a fresh full budget.messages_truncatedis no longer set for field-only truncation. A non-timeout Frida device lookup failure iscapability_unavailableinstead ofprovider_timeout. Timeout and limitation sentences changed. Numeric debugger, Frida, and Cutter caps are unchanged.command_timeout_msis optional.command_timeout_mslets an already admitted objdump or rizin command run longer. It does not raise output, concurrency, or debugger authority. The upper bound is the signed 32-bit timer ceiling, 2147483647 ms.Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.