Skip to content

fix(runtime): report the effective ask timeout so a clamped wait isn't misreported - #10550

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/ask-clamp-observable
Jul 25, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/ask-clamp-observable

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #10529, which added a 30-minute clamp on orchestration.ask's timeoutMs. The clamp was silent: the ask result carried no timeout figure, so the CLI printed the value the caller sent.

A worker passing --timeout-ms 3600000 is told ask timeout after 3600000ms after only 30 minutes of real waiting — off by 2x, and accurate before #10529 introduced the clamp. An agent reads that as "the coordinator is dead" and escalates, when re-asking is the correct response.

This echoes the effective budget on every ask return and prints that instead.

Why this is a separate PR

This commit was written during #10529's review and pushed to that branch, but GitHub never synced the PR head (head.sha stayed at the previous commit with no synchronize event for ~45 min), so the squash merge silently used the older sha and the fix was left behind. Recovering it here rather than losing it.

Shape

  • Additive optional field on the ask result — older clients fall back to the requested value.
  • CLI prefers the server's effective figure when present.
  • Also fixes a real test hazard: the clamp test's if (outbound) meant a missing reply let the handler's while (true) spin until vitest timed out, hanging instead of failing. Now asserts outbound is defined.

Verification

  • orchestration.test.ts — 116/116 pass on merged main
  • Mutation-verified non-vacuous: removing only the echo while leaving the clamp intact fails with AssertionError: expected undefined to be 1800000. So the new assertion pins observability specifically, not the clamp it depends on.

Not verified

No live SSH/relay/mobile client was driven. The orca serve / web reachability of orchestration.ask over WebSocket (scope runtime bypasses the mobile allowlist) is established by reading index.ts and ipc/mobile.ts, not by running one.

…t misreported

The 30-min clamp was silent: the ask result carried no timeout figure, so
the CLI printed the value the caller *sent*. A worker passing
--timeout-ms 3600000 was told "ask timeout after 3600000ms" after only
30 min of real waiting — off by 2x, and accurate before this PR added the
clamp. Echo the effective budget on every ask return and print that.

Additive optional field; older clients fall back to the requested value.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The orchestration RPC now returns the effective clamped timeoutMs for successful replies, client-aborted waits, and deadline timeouts. The associated test verifies the wait bounds and returned 1_800_000 millisecond value. The CLI handler accepts this response field and reports it when displaying timeout errors, falling back to the requested timeout when absent.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change well, but it is missing required template sections like Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes. Add the missing template sections, including screenshots/no visual change, a test checklist, AI review report, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: reporting the effective clamped ask timeout instead of the requested value.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/runtime/rpc/methods/orchestration.test.ts (1)

1815-1825: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the timeout and abort response paths.

This test inserts a reply, so it exercises only the successful return branch. Add focused cases for deadline expiry and signal.aborted to verify those newly changed responses also include the effective timeoutMs.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4bc8d07e-4261-4ece-8c8d-0cad63fa069b

📥 Commits

Reviewing files that changed from the base of the PR and between b31e9bb and b2889a2.

📒 Files selected for processing (3)
  • src/cli/handlers/orchestration.ts
  • src/main/runtime/rpc/methods/orchestration.test.ts
  • src/main/runtime/rpc/methods/orchestration.ts

@brennanb2025
brennanb2025 merged commit 505967e into main Jul 25, 2026
11 of 12 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…t misreported (stablyai#10550)

The 30-min clamp was silent: the ask result carried no timeout figure, so
the CLI printed the value the caller *sent*. A worker passing
--timeout-ms 3600000 was told "ask timeout after 3600000ms" after only
30 min of real waiting — off by 2x, and accurate before this PR added the
clamp. Echo the effective budget on every ask return and print that.

Additive optional field; older clients fall back to the requested value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant