[PR #5798] [MERGED] feat(wasm): make command deadlines adjustable with recovery guidance #7069

Closed
opened 2026-11-01 21:45:08 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5798
Author: @gensokyo-dev
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/20261021-budget-recovery


📝 Commits (3)

  • 06f0754 feat(wasm): make command deadlines adjustable with recovery guidance
  • 02d6c72 fix(wasm): retain timeout recovery through cleanup failures
  • e9cdf87 fix(wasm): share execution profiles with rejected-module evidence

📊 Changes

13 files changed (+375 additions, -61 deletions)

View changed files

📝 docs/wasm-artifacts.md (+21 -1)
📝 scripts/verify-wasm-artifact.mjs (+23 -1)
📝 src/application/wasm/WasmArtifactService.test.ts (+37 -0)
📝 src/application/wasm/WasmArtifactService.ts (+3 -0)
📝 src/cli/wasmCommands.ts (+5 -0)
📝 src/contracts/wasm/wasmToolContracts.ts (+1 -1)
📝 src/domain/wasm/wasmArtifact.ts (+12 -0)
📝 src/wasm/WabtArtifactProvider.test.ts (+95 -16)
📝 src/wasm/WabtArtifactProvider.ts (+20 -17)
📝 src/wasm/WabtFailures.test.ts (+96 -6)
📝 src/wasm/WabtFailures.ts (+42 -16)
📝 src/wasm/WabtRelease.ts (+0 -1)
📝 tests/boundary/mcp/wasmArtifactMcp.test.ts (+20 -2)

📄 Description

Summary

Fixes #5797. WABT's hardcoded 30-second command deadline could block an agent with no supported adjustment. Add optional command_timeout_ms / --command-timeout-ms, keeping the default and fixed input/output safety allowances unchanged.

Change and scope

The canonical WASM contract owns the positive-millisecond timer range. Shared CLI/MCP inputs reach the existing owned-command supervisor; actual selected budgets are retained in Evidence and checked against provider reports. WABT-specific timeout recovery names both controls, their per-command scope, client deadline headroom, maximum timer and cleanup requirements. No provider knob is guessed in generic error projection.

Ordinary extension of existing local-file analysis: caller-supplied WABT processes/private workspaces only. No WASM execution, installation, network access or new mutation authority; additional maintainer scope decision not applicable. No dependency/package changes. Ignored catalogs are regenerated, not committed.

Evidence and validation performed

Detailed executed evidence and limits: https://github.com/morluto/rea/issues/5797#issuecomment-6309988721

  • Three new regressions failed before the implementation; selected-budget enforcement/cleanup/retry, Evidence preservation and mismatched provider budget rejection now pass.
  • 80 focused tests passed, including advertised SDK-converted schemas and cancellation/retained cleanup; final provider-helper refactor also reran 33 cases successfully.
  • npm run check, npm run docs:check (including 5 README conformance tests), and npm run build:cached passed.
  • Actual Codex CLI: 13 sessions / 20 REA calls. Default 30,000 ms timeout recovered by selecting 120,000 ms and completing the same summary; version/analysis/invalid-zero controls recovered. Fixed input and incomplete cleanup stopped safely. Malformed-module recovery read only the exact retained Evidence's summary.
  • Real WABT 1.0.42: 51 CLI/MCP cases passed on final production code, including selected/default budgets in successful and rejected-module Evidence. Additional actual timeout/retry/fixed-limit parity passed. No natural large-module timeout or Windows/macOS qualification is claimed.
  • Two independent source reviews completed. Automated timeout-plus-cleanup and partial-profile findings fixed at their producing boundaries with fail-before/pass-after guards. Review threads include root cause, structural fix, verification and remaining scope.
  • Whole-agent actual usage: 1,812,606 input tokens (1,522,688 cached), 7,699 output; elapsed 644.665 s, family CPU 182.62 s, max sampled family RSS 1,200.109 MiB. Zero unchanged failed REA retries/no observed OOM. Warm/uncontrolled caches; no equivalent-completed-task speedup claim. Initial harness-identity failure and model-capacity review attempt retained, not relabeled passing. Three small workspaces from deliberate cleanup-uncertainty controls remain retained.

Compatibility and limits

Additive optional field; omitted budget stays 30,000 ms. Per-command timer range is 1–2,147,483,647 ms, not a whole-inspection budget. Fixed 8 MiB input / 32 MiB output allowances, target identity, complete Evidence retention and owned cleanup remain intact. Summary changes delivery, not analysis work.

Author readiness

Human owner: @gensokyo-dev

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Ready for review follows the human user's explicit standing instruction for this work. The agent does not assert that separate human final-diff/evidence review occurred; those declarations remain unchecked. Any policy override will be disclosed, not described as passing readiness.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5798 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/20261021-budget-recovery` --- ### 📝 Commits (3) - [`06f0754`](https://github.com/morluto/rea/commit/06f075479a56505a1fef509759fab5733fd8878b) feat(wasm): make command deadlines adjustable with recovery guidance - [`02d6c72`](https://github.com/morluto/rea/commit/02d6c724c7de3b83f5eb50f5a998de55b67ab616) fix(wasm): retain timeout recovery through cleanup failures - [`e9cdf87`](https://github.com/morluto/rea/commit/e9cdf873c58bd32e8f43b69f8a9a6d1ceb50d645) fix(wasm): share execution profiles with rejected-module evidence ### 📊 Changes **13 files changed** (+375 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `docs/wasm-artifacts.md` (+21 -1) 📝 `scripts/verify-wasm-artifact.mjs` (+23 -1) 📝 `src/application/wasm/WasmArtifactService.test.ts` (+37 -0) 📝 `src/application/wasm/WasmArtifactService.ts` (+3 -0) 📝 `src/cli/wasmCommands.ts` (+5 -0) 📝 `src/contracts/wasm/wasmToolContracts.ts` (+1 -1) 📝 `src/domain/wasm/wasmArtifact.ts` (+12 -0) 📝 `src/wasm/WabtArtifactProvider.test.ts` (+95 -16) 📝 `src/wasm/WabtArtifactProvider.ts` (+20 -17) 📝 `src/wasm/WabtFailures.test.ts` (+96 -6) 📝 `src/wasm/WabtFailures.ts` (+42 -16) 📝 `src/wasm/WabtRelease.ts` (+0 -1) 📝 `tests/boundary/mcp/wasmArtifactMcp.test.ts` (+20 -2) </details> ### 📄 Description ## Summary Fixes #5797. WABT's hardcoded 30-second command deadline could block an agent with no supported adjustment. Add optional `command_timeout_ms` / `--command-timeout-ms`, keeping the default and fixed input/output safety allowances unchanged. ## Change and scope The canonical WASM contract owns the positive-millisecond timer range. Shared CLI/MCP inputs reach the existing owned-command supervisor; actual selected budgets are retained in Evidence and checked against provider reports. WABT-specific timeout recovery names both controls, their per-command scope, client deadline headroom, maximum timer and cleanup requirements. No provider knob is guessed in generic error projection. Ordinary extension of existing local-file analysis: caller-supplied WABT processes/private workspaces only. No WASM execution, installation, network access or new mutation authority; additional maintainer scope decision not applicable. No dependency/package changes. Ignored catalogs are regenerated, not committed. ## Evidence and validation performed Detailed executed evidence and limits: https://github.com/morluto/rea/issues/5797#issuecomment-6309988721 - Three new regressions failed before the implementation; selected-budget enforcement/cleanup/retry, Evidence preservation and mismatched provider budget rejection now pass. - 80 focused tests passed, including advertised SDK-converted schemas and cancellation/retained cleanup; final provider-helper refactor also reran 33 cases successfully. - `npm run check`, `npm run docs:check` (including 5 README conformance tests), and `npm run build:cached` passed. - Actual Codex CLI: 13 sessions / 20 REA calls. Default 30,000 ms timeout recovered by selecting 120,000 ms and completing the same summary; version/analysis/invalid-zero controls recovered. Fixed input and incomplete cleanup stopped safely. Malformed-module recovery read only the exact retained Evidence's summary. - Real WABT 1.0.42: 51 CLI/MCP cases passed on final production code, including selected/default budgets in successful and rejected-module Evidence. Additional actual timeout/retry/fixed-limit parity passed. No natural large-module timeout or Windows/macOS qualification is claimed. - Two independent source reviews completed. Automated timeout-plus-cleanup and partial-profile findings fixed at their producing boundaries with fail-before/pass-after guards. Review threads include root cause, structural fix, verification and remaining scope. - Whole-agent actual usage: 1,812,606 input tokens (1,522,688 cached), 7,699 output; elapsed 644.665 s, family CPU 182.62 s, max sampled family RSS 1,200.109 MiB. Zero unchanged failed REA retries/no observed OOM. Warm/uncontrolled caches; no equivalent-completed-task speedup claim. Initial harness-identity failure and model-capacity review attempt retained, not relabeled passing. Three small workspaces from deliberate cleanup-uncertainty controls remain retained. ## Compatibility and limits Additive optional field; omitted budget stays 30,000 ms. Per-command timer range is 1–2,147,483,647 ms, not a whole-inspection budget. Fixed 8 MiB input / 32 MiB output allowances, target identity, complete Evidence retention and owned cleanup remain intact. Summary changes delivery, not analysis work. ## Author readiness Human owner: @gensokyo-dev - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. Ready for review follows the human user's explicit standing instruction for this work. The agent does not assert that separate human final-diff/evidence review occurred; those declarations remain unchecked. Any policy override will be disclosed, not described as passing readiness. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7069
No description provided.