Recover planner localization without downgrading Act - #2749
Merged
webbrain-one merged 2 commits intoAug 11, 2026
Merged
Conversation
|
@esokullu is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Pull request overview
Improves planner recovery for missing localization and corrects download mutation intent across Chrome and Firefox.
Changes:
- Backfills partial localization from canonical fields.
- Detects download/local-save plans requiring state changes.
- Adds cross-browser regression coverage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/chrome/src/agent/planner.js |
Updates Chrome planner normalization. |
src/firefox/src/agent/planner.js |
Mirrors planner behavior in Firefox. |
test/run.js |
Adds localization and download-intent tests. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // bounded local-save phrase covers compact plans, whose steps omit tools. | ||
| const actionText = [summary, ...steps.map(step => step.action)].join('\n'); | ||
| return actionText.split('\n').some(line => ( | ||
| /(?:^|[.!?]\s*|\b(?:and|then|to)\s+)download(?:s|ed|ing)?\s+(?!(?:links?|urls?|buttons?|pages?|instructions?)\b)\S/i.test(line) |
| // bounded local-save phrase covers compact plans, whose steps omit tools. | ||
| const actionText = [summary, ...steps.map(step => step.action)].join('\n'); | ||
| return actionText.split('\n').some(line => ( | ||
| /(?:^|[.!?]\s*|\b(?:and|then|to)\s+)download(?:s|ed|ing)?\s+(?!(?:links?|urls?|buttons?|pages?|instructions?)\b)\S/i.test(line) |
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.
Summary
Root cause
The compact planner could return otherwise valid execution intent without the presentation-only
localizedobject. The normalizer treated that omission as a fatal contract failure, so WebBrain repaired the planner response and could ultimately downgrade an Act turn to Ask/read-only mode even though the canonical execution fields were usable.Impact
Recoverable localization omissions no longer revoke Act execution. Canonical planner text becomes the safe display fallback for missing or partial translated fields, while execution metadata such as
requires_state_changeremains unchanged.Clarifications remain strict because their localized summary must contain the actual question presented to the user.
Deferred follow-up
Planner correction of incorrect download completion requirements is intentionally disabled and tracked separately in #2752. A prose heuristic was rejected because lookup framing such as
Find the URL to download the reportis semantically read-only despite containingto download.Validation
npm testgit diff --checkSource change:
a02b1435, rebased onto the current upstreammainfor a clean PR diff.