fix(mcp): let callers control the wait time cap and the act diff size - #2746
Merged
Merged
Conversation
wait for="time" no longer silently clamps a pure-time pause to the 30s
page-work polling cap. A time pause does no page work, so it is honored
up to the tool-call budget (120000ms) and a larger value is rejected
naming the cap instead of quietly under-waiting.
act now takes a diff param ("none" | "summary" | "full" | maxChars,
default "full") so a caller can suppress or cap the auto-included
post-action accessibility diff, which otherwise dumps the whole page on
every act. Char-based cap mirrors the evaluate maxChars control.
Fixes #2701
Fixes #2700
Contributor
✅ Tests passed: 2368/2371Ran 11 of 16 suites (5 not affected by this change).
|
Contributor
|
wait for="time": keep an explicit timeout as an upper bound on the pause (restores the documented bound the first pass dropped) while still lifting the 30s page-work clamp, and hold the pure-time ceiling below the tool-call budget so the documented maximum completes rather than racing the outer timeout. act diff: preserve the URL-change notice when a maxChars-capped readback is actually the new page's snapshot after a navigation, so a truncated snapshot never reads as an ordinary in-page diff.
…st tools
The rust crate that claw-server-rust serves to external MCP clients (Claude,
Codex over MCP) carried the same two issues as the TS tools: wait for="time"
silently clamped a pure pause to the 30s page-work cap, and act always dumped
the full post-action diff. Port both fixes so an external client gets the same
behavior as the built-in agent.
wait for="time" is honored up to 90000ms with an explicit timeout as an
optional upper bound; a larger value is rejected naming the cap. act takes a
diff control ("none" | "summary" | "full" | a character cap) and skips the
readback for "none", and the capped branch keeps the URL-change notice.
Update the browseros-neo skill in both copies (the repo-root copy and the
resource embedded into the server) to document the act diff control.
Contributor
Author
The crate's fallback instructions (browseros-mcp service) and the production claw-server instructions both carry the act guidance line that the neo skill carries; keep them consistent with the new act diff control.
Contributor
Author
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.
Two neo MCP cap/clamp ergonomics fixes, applied to both tool implementations so every client gets them: the TS
browser-mcptools (the built-in agent path) and the Rustbrowseros-mcpcrate thatclaw-server-rustserves to external MCP clients (Claude, Codex over MCP). The reporter's "Claude over MCP" hits the Rust path, so covering it is the point.wait for="time"no longer silently under-waits (Fixes #2701)A
for="time"pause is just an abortable sleep that does no page work, but it was clamped to the 30s page-work polling cap thattext/selectorwaits use. Sowait for="time" value=75000returnedwaited 30000mswith no signal, and a caller pacing a long in-page loop under-waited and re-polled.Now the pure-time pause is decoupled from that cap: it is honored up to 90000ms, an explicit
timeoutstill bounds it from above (a caller can cap a large or garbage value), and a value past the ceiling is rejected with an error that names the cap rather than being silently shortened. The ceiling sits below the tool-call budget so the documented maximum completes rather than racing the outer timeout. Thetext/selector30s polling cap is unchanged.actcan now suppress or cap the post-action diff (Fixes #2700)actunconditionally appended a full post-action accessibility diff. On a large page that is a full page dump on every action (thousands of tokens the calling agent mostly cannot use).actnow takes an optionaldiffcontrol:"full"(default): unchanged, the existing token-bounded diff with spill-to-file."summary": change counts only, no tree body."none": skip the diff entirely.maxCharscontrol onevaluate).The capped branch preserves the URL-change notice, so a truncated post-navigation snapshot is never mistaken for an ordinary in-page diff. The default path is left unchanged, so the
difftool and defaultactreadback are unaffected.Skill
The
browseros-neoskill documents the tools, and it lives in two synced copies (the repo-root copy and the resource embedded intoclaw-server-rust). Both now note the newactdiffcontrol.Tests
wait.test.ts,act.test.ts, anddiff-format.test.tscover the honored/rejected/bounded wait cases and the none/summary/maxChars/nav-notice diff cases.resolve_time_wait_ms, theactdiff mapping and untagged deserialization, and the summary/maxChars/nav-notice/truncation diff cases.The job-handle ask (#2703) is a larger async-job feature tracked separately.