Repository navigation
test(cli): pass explicit exec output budget in external archive fixture - #7135
Merged
Merged
Conversation
#7125 unified Code Mode output budgeting so external exec calls honor display_budget_chars (default 10,000 tokens / 40,000 UTF-16 chars) instead of always archiving at 7,500 chars. Because readArchivedResult() in external_codex_cli.mjs emitted 30,000 chars without setting max_output_tokens, exec returned inline output, JSON.parse threw a SyntaxError, and the worker exited without replying to session/prompt, causing antigravity_can_continue_after_host_restarts_during_a_prompt to hang until the 45s follow-up deadline. Set max_output_tokens: 1000 with a 12,000-char payload so archive continuation is exercised deterministically regardless of default budget changes, surface non-JSON archive replies clearly, and fail pending ACP session/prompt requests immediately when the fixture aborts. Refs #7125 Generated-by: Maka (Gemini)
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.
English
Summary
Fixes the deterministic
native-macos-agentCI failure inmaka-cli::external_jobs::antigravity_can_continue_after_host_restarts_during_a_promptintroduced after #7125.Refs #7125
Root cause
1599a73ac) unified Code Mode output budgeting soexecdefaults toDEFAULT_CELL_OUTPUT_TOKENS = 10_000(40,000UTF-16 chars) anddriver_external_effects.rs(display_projection) honorsdisplay_budget_charsinstead of always archiving atMAX_PAGE_CHARS(7,500).readArchivedResult()inproducts/maka/cli/tests/support/external_codex_cli.mjsstill emitted 30,000 chars without passingmax_output_tokens. Under the new 40,000-char default budget,execreturned unarchived multi-line output,JSON.parse(result.content[0].text)threw aSyntaxError, and the fake ACP worker exited without replying to the pendingsession/prompt, leavingterminal_statehanging until the 45sfollow-up completesphase deadline.external_jobs.rswere unaffected and remain healthy.Fix
max_output_tokens: 1000(4,000-char budget) with a 12,000-char payload inreadArchivedResult()so external archive creation andReadcontinuation are tested deterministically regardless of future default-budget changes.JSON.parsefailures asInvalid protocol JSON.session/promptrequest ID (clearing it onreply) and return a JSON-RPC error fromfail()when the fixture aborts mid-prompt so future fixture errors fail immediately instead of timing out after 45s.Verification
FAIL [61.920s]atexternal_jobs.rs:1600,deadline: follow-up completes).cargo nextest run --locked -p maka-cli --test external_jobs: 12 passed, 0 failed in 29.26s (antigravity_can_continue_after_host_restarts_during_a_promptpassed in 20.07s).npx biome check products/maka/cli/tests/support/external_codex_cli.mjs: passed (0 issues).rustfmt --edition 2024 --check products/maka/cli/tests/external_jobs.rs: passed.node scripts/ci.mjs check licenses: passed.AI use
Maka (Gemini) investigated the CI failure history, reproduced and diagnosed the root cause in
external_codex_cli.mjs, implemented the fix, and ran local verification.Checklist
Does this PR entail a change in behavior?
简体中文
摘要
修复 #7125 合并后导致
native-macos-agent连续失败的确定性回归(maka-cli::external_jobs::antigravity_can_continue_after_host_restarts_during_a_prompt)。Refs #7125
根因
1599a73ac)统一了 Code Mode 输出预算,exec默认预算提升至DEFAULT_CELL_OUTPUT_TOKENS = 10_000(40,000 UTF-16 字符),且driver_external_effects.rs的display_projection开始遵循display_budget_chars,不再固定按MAX_PAGE_CHARS(7,500)归档。products/maka/cli/tests/support/external_codex_cli.mjs中的readArchivedResult()仍只输出 30,000 字符且未显式指定max_output_tokens,因此输出未触发归档而是直接内联返回;随后的JSON.parse(result.content[0].text)抛出SyntaxError,ACP worker 直接退出而未回复正在等待的session/prompt,导致测试卡在follow-up completes直到 45 秒超时。external_jobs.rs中其余 11 个测试均未受影响且表现稳定。修复内容
readArchivedResult()中显式传入max_output_tokens: 1000(4,000 字符预算)并输出 12,000 字符,既验证外部 MCPexec正确传递预算并触发归档续读,也避免后续再次调整默认预算时误伤该测试。fail()掩盖为Invalid protocol JSON。session/prompt请求 ID(在reply后清空),在fail()中主动返回 JSON-RPC error,避免后续测试桩异常时再次静默卡死 45 秒。验证
FAIL [61.920s],deadline: follow-up completes)。cargo nextest run --locked -p maka-cli --test external_jobs:12 passed, 0 failed(总耗时 29.26s,其中目标用例 20.07s 通过)。npx biome check products/maka/cli/tests/support/external_codex_cli.mjs:通过。rustfmt --edition 2024 --check products/maka/cli/tests/external_jobs.rs:通过。node scripts/ci.mjs check licenses:通过。AI 使用声明
由 Maka (Gemini) 完成 CI 失败排查、本地复现、根因定位、修复及本地验证。
检查项
本 PR 是否引入产品行为变更?