Repository navigation
fix(ida): supervise regex inventory matching - #4862
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. |
|
@codex review |
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummaryIDA procedure and string searches now share inventory filtering. Regex searches use the existing supervised worker; literal searches keep their current matching.
No actionable issues or security defects were found. Tests were not run during this review. Whether another PR supersedes this one could not be checked because GitHub access required authentication. DiagramsequenceDiagram
participant Caller
participant Session as IdaSessionClient
participant Runner as IdaOperationRunner
participant IDA
participant Worker as Regex worker
Caller->>Session: Search with optional signal
Session->>Runner: Run search
Runner->>IDA: Read inventory
IDA-->>Runner: Ordered items
alt Literal mode
Runner->>Runner: Filter locally
else Regex mode
Runner->>Worker: Pattern and values
Worker-->>Runner: Matching indices or typed error
Runner->>Worker: Await termination
end
Runner-->>Session: Ordered matches or error
Session-->>Caller: Result
Reviews (1) · Last reviewed commit: "fix(ida): supervise regex inventory matc..." · Reviewed by Greptile |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Thanks, @jgt87, for moving IDA regex searches onto the supervised matcher. Expensive patterns can now be cancelled without blocking the service thread, and the recovery cases cover using the same session afterward. Welcome aboard! |
* fix(mcp)!: return a compact binary_session status by default
binary_session {} with no target open returned about 66 KB, most of it
provider rejection diagnostics and candidate capability sets that the
skill's recovery flow re-reads on every retry. 6.8.0 grew it by 21%
because the shared regex capability limitation began repeating setting
bounds and step-by-step recovery for every search operation of every
provider (#6099, #6267, #6301, #7049) and IDA gained that limitation for
its two search operations (#4862).
The regex limitation now states the effective deadline and heap, their
sources and where to change them; the deadline and heap errors keep the
full recovery. binary_session gains detail: summary (default) or
complete. The summary keeps open state, target identity, the binding,
route capabilities, run, activity and health status, each candidate's
availability and target-support status, code and reason, and every
tool's availability, reason, remediation and modes, and lists the
fields it leaves out in omitted_fields. Complete detail returns the
previous shape. The CLI capabilities and providers commands keep
complete provider facts through the same application projection.
BREAKING CHANGE: binary_session {} no longer returns
analysis_provider_candidates[].availability.diagnostics,
target_support.diagnostics or capabilities, or tool_availability group
surface, effects and annotations. Pass {"detail": "complete"} to get
them.
Fixes #7109
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(mcp): key binary_session output fields by detail
The output schema accepted detail: "complete" with summary candidates or
tool groups, and a summary without omitted_fields, so detail did not
tell callers which fields existed. Each session kind is now crossed
with a detail-specific shape: a summary requires omitted_fields and
summary-only candidates and tool groups; complete requires diagnostics,
candidate capabilities and static tool flags and forbids omitted_fields.
Both the canonical schema and the SDK-validated advertised schema reject
mismatched shapes.
The verifier helper accepts summary candidates only for a validated MCP
summary; CLI provider output still requires candidate capabilities.
Regex limitation tests check values, sources and setting names instead
of whole sentences.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Fixes #4860. IDA regex searches currently run
RegExp.teston REA's service thread, preventing caller cancellation during CPU-bound matching. Reuse the existing supervised regex worker so cancellation and the five-second matching deadline return typed errors while the session stays usable.Problem and expected behavior
With
^(a+)+$against"a".repeat(26) + "!", both production-session regression cases return success on the base despite a scheduled 50 ms cancellation. The service thread must remain available to process cancellation; matching must have a bounded lifetime.Change and scope
Share the IDA inventory filtering path between procedure and string searches. Regex mode uses
matchRegexValueswith the caller signal and awaited worker termination; literal mode keeps its current matching. Preserve source order and publish the existing regex limitation in search capabilities and successful regex evidence. No new provider, target execution authority, or upstream IDA operation is introduced.Contract and boundary impact
IdaOperationRunner.Expected effects:
Local matching creates a worker thread, with the existing shared heap and time limits. No new target process, injection, or target writes.
Evidence and regression coverage
d5be402fb3dbfc56ac9854c27b5538df20cc2437with only the two cancellation cases added: 2 failed, both returnedok: true; test durations 3077 ms and 594 ms. After the fix those cases passed in 69 ms and 57 ms in the first isolated run. These are test durations, not matching-only benchmarks.IdaSessionClient.executeboundary withRecordingIdaMcp. They do not establish actual IDA engine behavior.Validation performed
node node_modules/vitest/vitest.mjs run src/ida/IdaSessionClient.test.ts -t "cancels CPU-bound" --reporter=verbose— base 2 failed; fixed 2 passed.node node_modules/vitest/vitest.mjs run src/ida/IdaSessionClient.test.ts -t "attached IDA function observations|attached IDA regex supervision|attached IDA function failure handling|attached IDA legacy string inventory" --reporter=default— 11 passed, 55 skipped.npm run check:fast— typecheck and lint passed.git diff --check— passed before commit; commit hook formatting/lint passed.npm run test:local -- src/ida/IdaSessionClient.test.tson the base plus two cancellation tests — 46 failed, 17 passed; includes the two reproduced failures and 44 other failures in unchanged cases. This Windows checkout's broader suite is not verified. No claim that the full suite passes.npm run build:windows-native— unavailable on this host: the artifact build script requires Linux and MinGW-w64. No native binary/build outputs are included.Compatibility, safety, and release
Author readiness
Human owner: @jgt87
Before merge
type(scope): outcome.