Conversation
…dline navigate, navigate_back, navigate_forward, reload and wait_for_navigation resolve with a structured result at their own timeout_ms: reached "timeout", the URL the page actually reached and the last observed lifecycle. The daemon dispatched them with a transport deadline equal to that same timeout, so the extension's reply still had to cross the socket after the deadline had fired. The reply then took the TimedOutAfterResponse path, which preserves completed results only for session_stop, tab_borrow, request_help and the effect-aware transfers, so the caller received a bare "tool RPC timed out" instead. Grant these five methods the EXTENSION_RESPONSE_GRACE that upload, download and request_help already use. They are the complete set of tools whose extension handler resolves with "reached: timeout" at a caller-supplied deadline; every other tool is unchanged.
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.
Problem
navigate,navigate_back,navigate_forward,reloadandwait_for_navigationdo not fail when their lifecycle wait expires. They resolve with a successful result —reached: "timeout", thefinal_urlthe page actually reached, and anerror_textnaming the last observed lifecycle — so the agent can tell a slow page from a stuck one and decide whether to wait, retry or report.tool_dispatch_transport_timeoutgives those methods a transport deadline equal to the operation's owntimeout_ms, and the two defaults coincide:DEFAULT_NAV_TIMEOUT_MSin the extension andDEFAULT_TOOL_TIMEOUTin the daemon are both 30s. The extension's reply is therefore due at the exact instant the daemon's deadline fires, and still has to cross the socket afterwards. When the deadline wins,wait_for_dispatchtakesWaitOutcome::TimedOutAfterResponse, which preserves a completedOkonly forsession_stop,tab_borrow,request_helpand the effect-aware transfers. Navigation falls through to the final arm, so the caller receives a baretool RPC timed out after 30sand the structured outcome the extension had already produced is discarded.upload,downloadandrequest_helpown their deadline the same way and are already grantedEXTENSION_RESPONSE_GRACEfor exactly this reason.Change
Add the five navigation methods to that grace, and widen the constant's comment now that it covers more than the upload transaction.
These five are the complete set of tools whose extension handler resolves with
reached: "timeout"at a caller-supplied deadline (tools/navigation.tsfor navigate / back / forward / reload,tools/waits.tsfor wait_for_navigation). Every other tool either rejects on timeout or has no caller-supplied deadline, andextension_response_grace_does_not_change_other_toolsstill pinsclickto the rawtimeout_ms.If you would rather keep the deadline at
timeout_msand instead extend theTimedOutAfterResponsepreserve list inqueue.rsto navigation results, I am happy to switch. The grace seemed closer to the precedent already in this function.Validation
cargo test --workspace --lockedpasses, including the two assertions above.cargo fmt --all -- --checkandcargo clippy --workspace --all-targets --locked -- -D warningspass.matches!arm while keeping the new assertions fails both tests — 30s vs 32s for the default deadline and 60s vs 62s for an explicittimeout_ms: 60000.Unrelated flakes seen while validating
Worth a separate look, not part of this change:
skill_install::harness::tests::skills_dirs_match_harness_specfails about 1 run in 10 ofcargo test -p bsk --lib, at the same rate on unmodifiedmainand on this branch, and never with--test-threads=1. Sibling tests in that binary set and restoreHERMES_HOME/KIMI_CODE_HOMEwhile it reads them. I also saw oneremote_server::browser_capacity_does_not_block_renewal_or_replacementfailure where the spawned server did not writedaemon.jsoninside the 10s readiness window; it did not recur. Happy to file these separately.