Repository navigation
feat(android): make the JADX operation deadline configurable - #4466
Merged
Merged
Conversation
JADX operations used a fixed 120 s provider deadline and a separate fixed 120 s per-call bound in the session, so an APK whose cold load exceeds 120 s could not complete, and raising only the MCP client timeout could not extend either. Add REA_JADX_OPERATION_TIMEOUT_MS, parsed once by the JADX configuration owner (decimal milliseconds from 1 to 2147483647, default 120000). The provider resolves it before acquiring anything and uses it for the operation deadline and its timeout errors, and the session uses it for every upstream call. Doctor reports the effective value, and setup forwards an explicit value like the other JADX settings. Fixes morluto#3918 Co-Authored-By: Claude Opus 5.5 <[email protected]>
SandstromPL
marked this pull request as ready for review
October 16, 2026 13:46
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. |
Contributor
[Medium impact] The PR appears safe to merge; the previous fixture issue is fixed and no new blocking issue was found. SummaryMakes the JADX operation deadline configurable through
Reviews (2) · Last reviewed commit: "test(android): isolate JADX fixtures fro..." · Reviewed by Greptile |
The shared JADX protocol fixture spread the developer's process.env, so an exported REA_JADX_OPERATION_TIMEOUT_MS (or REA_JADX_HEAP_MIB) changed every provider test that never selected one. Keep inheriting the host environment for process launch, but take REA_JADX_* settings only from the fixture. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
Good catch for this one! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3918.
JADX operations had two fixed 120-second limits:
OPERATION_TIMEOUT_MSinJadxProvider.ts)timeout: 120_000inJadxSession.ts)A large multidex APK whose cold load exceeds 120 s therefore always ended in
provider_timeout, and raising only the MCP client's timeout could not extend either limit.This PR adds an optional setting,
REA_JADX_OPERATION_TIMEOUT_MS. It is a decimal millisecond count from 1 to 2147483647, and the default stays 120000. One parsed value bounds both the whole operation and each upstream call. Unset keeps today's behavior.Problem and expected behavior
provider_timeoutat exactlytimeout_ms: 120000on a large multidex APK. Area_jvm_statusreply was retained, but the load never completed.Change and scope
src/android/JadxConfiguration.ts):readOperationTimeoutparses the setting once, reusingproviderStartupTimeoutSchema. The error text matchesREA_KUNA_TIMEOUT_MS.operation_timeout, classifiedconfig_drift.DEFAULT_JADX_OPERATION_TIMEOUT_MSlive inJadxRelease.ts.src/android/JadxProvider.ts):#executeresolves the deadline as aResultbefore acquiring any file handle, workspace or engine.AbortSignal.timeoutand bothAnalysisTimeoutErrorsites.JadxSession.execute. The deadline still starts at the queue front.src/android/JadxSession.ts): everycallTooluses the selected value instead of120_000.AnalysisTimeoutError.inspectJadxAvailabilityreportsoperation_timeout_ms, and the passing JADX doctor check exposes it indetails.JadxDoctorpublishes an explicit value inregistrationEnvironment, likeREA_JADX_HEAP_MIB, sorea setupforwards it.docs/android-analysis.md,docs/client-configuration.md, and the skill referencereferences/android-applications.md.Contribution scope: a configuration option for an existing read-only static provider, so a maintainer scope decision is not applicable.
Intentionally not included:
tool_timeout_secand KimitoolTimeoutMs(mcpStartupPolicy.ts,doctorRuntime.tsresolveProviderRequestBudget) don't count this setting. This matchesREA_KUNA_TIMEOUT_MSandREA_KUNA_PROJECT_TIMEOUT_MS, which are also forwarded without counting. Including it would mean restructuring a seam that currently runs only forida/auto, so I've documented the gap inclient-configuration.mdandandroid-analysis.mdinstead. I'm happy to do it as a follow-up.AnalysisTimeoutErrorpresentation still says "Try a smaller request". Changing that needs a shared error-presentation change, so it's deferred.load_apk(source-derived).Contract and boundary impact
src/android/JadxConfiguration.ts, at provider configuration before target admission.provider_timeoutdetails.timeout_msnow reports the selected value.capability_unavailable(open_options_invalid) before Java starts.details.operation_timeout_ms(additive).generate-skill-metadata.mjs --checkpasses, and no skill version bump is needed.skills/is not committed.rea setupplan can now forward an explicitly setREA_JADX_OPERATION_TIMEOUT_MSinto client registrations. The ambient environment is never persisted.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
rea setupclient registration may now include an explicitly setREA_JADX_OPERATION_TIMEOUT_MS, likeREA_JADX_HEAP_MIB)Evidence and regression coverage
Tests added or updated:
tests/boundary/process/jadxIntegration.test.ts, which uses the real owned-subprocess fake JADX MCP producer:inspect_android_packagerequests withREA_JADX_OPERATION_TIMEOUT_MS=1500. Each ends asAnalysisTimeoutErrorwithtimeoutMs: 1500and its own engine launch (2 launches). Each keeps therea_jvm_statuspartial observation and projectsprovider_timeoutwithdetails.timeout_ms: 1500. Ownership is released beforeprovider.close().2147483647, so there is no 1 ms timer clamp.""and2147483648are refused with no Java probe and no launch.SdkErrorCode.RequestTimeoutanddata.timeout: 300whentimeoutMs: 300. This is a module-level test because the former fixed 120 s call limit is unreachable in a workflow test.tests/boundary/android/jadxConfiguration.test.ts: effectiveoperation_timeout_msfor unset (120000),1,900000and2147483647. The full invalid matrix ("",0,-1,1.5,1e3," 5",abc,2147483648) returnsopen_options_invalidwithfailure_kind: operation_timeout.tests/boundary/android/jadxDoctor.test.ts: the default and explicitdetails.operation_timeout_ms, the registration environment carrying the explicit value, and invalid-value remediation naming the setting.tests/fixtures/android/jadx.ts: optional settings overrides. Since 6373f60 (review follow-up), the fixture no longer inheritsREA_JADX_*settings from the developer's shell, so an exported deadline or heap value cannot change tests that never selected one.Base reproduction: on base
fe2a398ddwith onlysrc/android/reverted, 8 of the new or changed tests fail. The two deadline tests fail by hitting vitest's 30 s timeout, because the setting was ignored and the fixed 120 s limits applied. The other 67 pass, including the largest-deadline success control, which is expected because the base ignores the setting.Example output:
{"code":"provider_timeout","details":{"operation":"inspect_android_package","timeout_ms":1500}}REA_JADX_OPERATION_TIMEOUT_MS must be a decimal millisecond count from 1 to 2147483647; received abc.Remaining proof gaps:
For evidence-bearing changes:
Validation performed
Run on Linux with Node 24.18.0 and npm 11.16.0:
npm run test:focused --on the 3 JADX test files plus 13 related Android, doctor, capability and module-boundary test files (16 files listed below): 16 files, 268 tests passed.tests/boundary/process/jadxIntegration.test.ts,tests/boundary/android/jadxConfiguration.test.ts,tests/boundary/android/jadxDoctor.test.ts,src/application/CapabilityInventory.test.ts,src/doctorRuntime.test.ts,tests/acceptance/nonBinaryComposition.test.ts,tests/boundary/android/JadxAnalysis.test.ts,tests/boundary/android/jadxMcpTransport.test.ts,tests/boundary/android/jadxProtocol.test.ts,tests/boundary/mcp/androidLateCompletionMcp.test.ts,tests/boundary/mcp/androidPackageSummaryMcp.test.ts,tests/boundary/process/androidAnalysisMcp.test.ts,tests/boundary/process/androidSearchEvidenceBudget.test.ts,tests/boundary/process/jadxHashCleanup.test.ts,tests/boundary/providers/android/androidLateCompletion.test.ts,tests/evaluation/moduleBoundaries.test.ts.src/android/reverted to base: 8 failed, 67 passed (as described above).npx tsc -p tsconfig.json --noEmit: clean.npm run check: passed. Lint reports 0 errors, and the touched files have the same per-rule warning counts as base.npm run docs:check: passed (includes the skill metadata and doc-facts checks).npm run verify:test-discovery: discovered all 1417 test files exactly once.npx oxfmt --checkon the changed files: passed.REA_JADX_OPERATION_TIMEOUT_MS=1 REA_JADX_HEAP_MIB=abc REA_JADX_ACTIVE_PROCESSOR_COUNT=0exported,npm run test:focused --on the 7 fixture-based Android boundary files passed 63/63. Before the fix,jadxIntegration.test.tsalone had 38 failures under the same exports.npx tsc -p tsconfig.json --noEmitwas clean, andnpm run check:fastpassed.npm run check:prnpm run verify:package(downloads[email protected]; CI runs it)npm run verify:android(needs a full JDK and downloaded public fixtures)Compatibility, safety, and release
REA_JADX_HEAP_MIB.Author readiness
Human owner: @SandstromPL
Before merge
type(scope): outcome.🤖 Generated with Claude Code