You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 99f9090
Browse filesBrowse the repository at this point in the historyBrowse files
fix: exempt attempt_completion from disabledTools (Zoo-Code-Org#1751)
* fix: exempt attempt_completion from disabledTools
A disabledTools entry naming attempt_completion removed the completion
tool from prompt generation and API declarations, and runtime
validation rejected every call, so a task could never finish.
The effective tool policy now partitions such entries out of the
user's disabledTools list once, at policy entry, before any filtering
step, and surfaces the ignored entries as a single in-task notice per
new task. Prompt generation, API declarations, and runtime validation
all derive from the same resolved policy, so they cannot disagree
about which tools are callable. Stored configuration is left
byte-untouched. The other always-available tools remain blockable,
and a model-profile excludedTools entry still strips
attempt_completion.
Code comments that stated the old precedence are corrected
(comment-only).
Issue: Zoo-Code-Org#1640
* test: cover missing- and corrupt-text branches of the disabled-tools notice
The patch-coverage check flagged two untested branches in the ChatRow case
that renders the ignored disabled-tools notice: the row renders nothing when
the message carries no text, and when the stored payload is not valid JSON.
Add spec cases for both so every render path of the notice is covered.
* Strengthen exemption tests and guard the ignored-tools notice render
Follow-up to PR review feedback on the attempt_completion exemption.
presentAssistantMessage-custom-tool.spec.ts asserted only that
attemptCompletionTool.handle was called for a disabled
attempt_completion entry. The assertion now also pins the arguments:
the task, the attempt_completion tool-use block, and the callback
object including its toolCallId.
ChatRow rendered the ignored disabled-tools warning by calling join on
the parsed ignoredTools field after only a truthy check, so a
corrupted persisted payload (a string, or an array containing
non-strings) threw during render. The field is now treated as unknown
and the row renders nothing unless it is a non-empty array of strings.
Three regression tests in IgnoredDisabledToolsNotice.spec.tsx cover
those payload shapes.
The translation mock in IgnoredDisabledToolsNotice.spec.tsx now types
its options parameter as Record<string, unknown> instead of
Record<string, any>.
* Cover the resume path in the ignored disabled-tools notice tests
Follow-up to PR review feedback on Zoo-Code-Org#1751.
The notice that a disabled attempt_completion entry is ignored was
only pinned on the new-task path: the spec drove startTask and
asserted exactly one ignored_disabled_tools_warning message. The
documented behavior that resuming a saved task does not re-emit the
notice had no test.
Task.ignored-disabled-tools-notice.spec.ts now also drives
resumeTaskFromHistory for a history item whose profile lists
attempt_completion in disabledTools. The new test asserts that no
ignored_disabled_tools_warning message is said during the resume,
next to liveness checks (the resume_task ask is issued and the task
loop starts once) so a silent early return cannot pass as a
zero-notice result. The provider fixture was extracted from the
startTask helper so both paths share it; the existing new-task
assertions are unchanged.
* fix: drop the availability claim from the ignored-tools notice
Follow-up to PR review feedback on Zoo-Code-Org#1751.
The notice telling the user that a disabled attempt_completion entry
was ignored claimed the tool "will remain available". That is false in
one state: when the active model profile's excludedTools also names the
tool, the effective policy still strips it, so the notice overpromised.
The profile-level excludedTools veto is intentional behavior, so the
copy changed rather than the policy.
messageTemplate now only states why the entry was ignored: "The
following tools cannot be disabled, so their disabledTools entries were
ignored: {{tools}}." The string is updated in all 18 locale chat.json
files; every locale currently replicated the false claim, so an en-only
edit would leave 17 of them asserting it. Task.ts detection and
emission are untouched, and {{tools}} is byte-preserved everywhere.
Two test changes lock in the fix. In
IgnoredDisabledToolsNotice.spec.tsx the two assertion strings move to
the new copy and a regression test renders the notice and fails if any
availability wording reappears (6 tests to 7). validateToolUse.spec.ts
gains a builder/validator agreement table: real buildToolRequirements
output driven through the real isToolAllowedForMode and validateToolUse
across six rows, including the overlap case where both lists name
attempt_completion and the profile veto wins. Additions only; every
pre-existing test is byte-identical (27 tests to 33).
* fix(task): keep the ignored-disabled-tools notice from blocking task start
CodeRabbit follow-ups on Zoo-Code-Org#1751: wrap the startTask notice emission in try/catch (mirroring getEnabledMcpToolsCount) so a rejecting provider state read cannot keep the task loop from starting, with a regression test; and feed a duplicate protocol-tool entry through the startup notice test so a regression of the partitionDisabledToolsForProtocol de-dup fails behaviorally.
* test(webview): read real locale files in the ignored-tools notice spec
* test(webview): add visual snapshot for the ignored disabled-tools warning row
Renders ChatRowContent for an ignored_disabled_tools_warning say message through the Playwright gallery across all four VS Code themes, using the real en locale strings. Baselines are generated in the pinned container (see webview-ui/AGENTS.md).
* test(webview): add container-generated baselines for the ignored disabled-tools warning
PNGs taken from the webview-visual-regression artifact of the pinned Playwright container workflow (per webview-ui/AGENTS.md fallback), not host renders.
* test(task): drop unused vscode import from the ignored-tools notice spec
---------
Co-authored-by: Elliott de Launay <[email protected]>
0 commit comments