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
fix(acp): keep an empty config choice distinct from a literal _t3/empty value - #46727
An ACP select option may legally advertise both "" and the literal value _t3/empty. T3 maps "" to the picker ID _t3/empty but also lets a native _t3/empty through unchanged, so the two collide. The picker drops one choice, can label the wrong one as current, and adapter.ts always turns the shared ID back into "".
Deterministic repro on origin/main (2e424655e3cdc0e0d8337807d97cd1e6de90bf53): a Local ACP agent advertises configId:"setting", currentValue:"_t3/empty", options:[{value:"",name:"Auto"},{value:"_t3/empty",name:"Literal"}]. The agent's config options reach acpProviderOptionDescriptors (packages/provider-acp/src/server/sessionConfig.ts) through onSessionConfigurationUpdate, which publishes the descriptor to the web, desktop and mobile pickers. Saved selections return through configureSession in packages/provider-acp/src/server/adapter.ts and become session/set_config_option.
Observed: the descriptor is [{id:"_t3/empty",label:"Auto"}] with Auto as current. Literal is missing and cannot be sent, because the adapter decodes _t3/empty to "".
Expected: both labels appear, Literal is current, and each choice sends its own native value.
Change
A native _t3/empty now gets its own picker ID, ACP_LITERAL_EMPTY_OPTION_VALUE (_t3/empty/ padded to 257 characters). Discovery drops values longer than MAX_TEXT_LENGTH (256), so no advertised value is ever offered under that ID. adapter.ts maps the ID back to _t3/empty next to the existing _t3/empty → "" mapping. "" and every other value keep the IDs they had on main. A choice with a blank name is now labelled with its native value rather than its ID, so the alias is never shown. The descriptor is shared, so web, desktop and mobile pick this up with no client changes.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Base → head: in apps/server, vp test run src/orchestration-v2/Adapters/AcpAdapterV2.test.ts -t "empty-valued default choice". The repo's ACP mock agent runs over stdio with T3_ACP_EMIT_EMPTY_DEFAULT_AGENT_OPTION=1 and now also advertises _t3/empty/Literal. On base the Literal choice is missing. On head all three choices are listed. The outgoing session/set_config_option values are ["example", "_t3/empty", ""], and the descriptor's current value follows each pick.
Base → head: in packages/provider-acp, vp test run src/server/sessionConfig.test.ts -t "literal _t3/empty". The option advertises ""/Auto, _t3/empty and _t3/empty/literal (both with blank names), with _t3/empty current. On base _t3/empty is dropped and Auto shows as current. On head all three choices are kept with distinct IDs, labels fall back to the native values, and Literal is current.
Raw selections (review finding): the selection contract accepts any non-empty trimmed string, and main already sends every such string except _t3/empty unchanged. So no ID is left over for the literal choice: whatever ID it gets, one raw string must change meaning, just as main already reserves _t3/empty for "". This PR reserves exactly one more string, which is 257 characters long. Discovery can never offer it, so it can only arrive if typed by hand. Every other raw value, including _t3/empty/literal, is still sent unchanged no matter which choices the agent advertises later. A per-session encoding would avoid reserving a string but lets saved IDs change meaning (round 1 finding), and a separate alias field would need a contract change beyond this fix.
The mode ceiling check still runs on the picker ID, before mapping, as on main; this PR leaves that order unchanged.
commit-checked.sh --amend → vp run check:changed exit 0: format, lint, knip, typecheck (13 packages) and tests (4 files) all pass. The full log is attached to the gist.
Not shown: no scenarios:prove run or picker screenshots. Clients render the server descriptor unchanged. To reproduce in the app, add a Local ACP provider whose command is node apps/server/scripts/acp-mock-agent.ts, with env T3_ACP_EMIT_EMPTY_DEFAULT_AGENT_OPTION=1. Open a thread on it, open the model picker's Agent control, pick Literal and send a turn; the mock sets currentAgent to the value it receives. That flow was not driven here, and no real third-party ACP agent was used.
Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown
.github/pull_request_template.md:12 — In the draft, call 2e42465 the tested base rather than the current origin/main; origin/main has advanced to 8184b93 without changing the affected path.
.github/pull_request_template.md:24 — No automated scenarios:prove replay was run; retain that disclosure and, if adding proof, run the Local ACP mock through the picker with an explicit base fixture that advertises both values.
.github/pull_request_template.md:24 — No before/after picker captures were taken; retain that disclosure or attach captures showing Literal missing on base and selectable on head.
.github/pull_request_template.md:24 — The exact collision was reproduced with the stdio mock, not a real third-party ACP agent; retain that distinction.
Macroscope's review found this PR approvable — This change keeps empty ACP choices distinct from literal _t3/empty values and translates each back before applying it. Its scope is limited to option encoding and display, with existing selection validation and policy controls retained.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between c6239de and e3e520f.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The ACP session-option descriptor now distinguishes an empty value from the literal _t3/empty value. Session configuration maps the literal sentinel, and mock-agent and adapter tests cover both values.
Changes: ACP agent-option empty-value handling
Layer / File(s)
Summary
Option value encoding packages/provider-acp/src/server/sessionConfig.ts, packages/provider-acp/src/server/sessionConfig.test.ts
The descriptor assigns a distinct ID to literal _t3/empty and uses the choice value as a label fallback. Tests cover empty, literal, and prefixed literal values.
Adapter mapping and coverage apps/server/scripts/acp-mock-agent.ts, packages/provider-acp/src/server/adapter.ts, apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
The mock agent adds a literal _t3/empty choice. The adapter maps its sentinel during session configuration, and adapter tests check both selected values and outgoing configuration.
This change keeps an empty option value and a literal _t3/empty value as separate picker choices. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the actual fix: a native literal _t3/empty value is kept distinct from the empty config choice in the ACP picker. It matches the changes in sessionConfig.ts, adapter.ts, and the rela…
Description check
The description follows the repository template. It covers Problem with a deterministic repro and expected behavior, Change explaining the new picker ID and mapping, Scope stating why no issue is need…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the actual fix: a native literal _t3/empty value is kept distinct from the empty config choice in the ACP picker. It matches the changes in sessionConfig.ts, adapter.ts, and the related tests. It follows the conventional commit style from the template and is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description follows the repository template. It covers Problem with a deterministic repro and expected behavior, Change explaining the new picker ID and mapping, Scope stating why no issue is needed for a small obvious bug fix, and Verification with focused test commands, observed base-versus-head results, a full check run, and a gist link. It also discloses what was not checked, including no screenshots, no real third-party ACP agent, and no scenarios:prove run. The template's conventional-commit reminder at the top is not applicable to the body and does not need to be repeated. Minor gap: the description does not mention the model/harness attribution in the required form beyond a 'Authored by' line, which is present. Overall the description is substantially complete.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Environment: Linux, Chromium web client, 1280×800, light theme, fresh isolated database per commit; repository ACP mock from the head used identically on both sides, initialized to the reported literal value.
On each commit, start a fresh real web app, register the PR's repository ACP mock with both empty and literal choices and initial currentAgent="_t3/empty", create a project and a Mock ACP (Literal)/Auto thread through the real CLI, send its first turn, then open the model picker → Options → Agent. Base stops at the missing Literal assertion. On head, select example, Copilot, then Literal, send a turn after each, reopen the menu, and check the fixture's incoming session/set_config_option values.
Scenario: Empty and literal ACP agent choices remain independently selectable
Head sends agent values "example", "", and "_t3/empty" for the three respective choices.
Not shown:
The pre-first-turn draft picker was not exercised; captures show the picker in a started thread after its first turn. Desktop and mobile surfaces were not exercised.
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
size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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
An ACP select option may legally advertise both
""and the literal value_t3/empty. T3 maps""to the picker ID_t3/emptybut also lets a native_t3/emptythrough unchanged, so the two collide. The picker drops one choice, can label the wrong one as current, andadapter.tsalways turns the shared ID back into"".Deterministic repro on
origin/main(2e424655e3cdc0e0d8337807d97cd1e6de90bf53): a Local ACP agent advertisesconfigId:"setting",currentValue:"_t3/empty",options:[{value:"",name:"Auto"},{value:"_t3/empty",name:"Literal"}]. The agent's config options reachacpProviderOptionDescriptors(packages/provider-acp/src/server/sessionConfig.ts) throughonSessionConfigurationUpdate, which publishes the descriptor to the web, desktop and mobile pickers. Saved selections return throughconfigureSessioninpackages/provider-acp/src/server/adapter.tsand becomesession/set_config_option.[{id:"_t3/empty",label:"Auto"}]with Auto as current. Literal is missing and cannot be sent, because the adapter decodes_t3/emptyto"".Change
A native
_t3/emptynow gets its own picker ID,ACP_LITERAL_EMPTY_OPTION_VALUE(_t3/empty/padded to 257 characters). Discovery drops values longer thanMAX_TEXT_LENGTH(256), so no advertised value is ever offered under that ID.adapter.tsmaps the ID back to_t3/emptynext to the existing_t3/empty→""mapping.""and every other value keep the IDs they had onmain. A choice with a blank name is now labelled with its native value rather than its ID, so the alias is never shown. The descriptor is shared, so web, desktop and mobile pick this up with no client changes.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
apps/server,vp test run src/orchestration-v2/Adapters/AcpAdapterV2.test.ts -t "empty-valued default choice". The repo's ACP mock agent runs over stdio withT3_ACP_EMIT_EMPTY_DEFAULT_AGENT_OPTION=1and now also advertises_t3/empty/Literal. On base the Literal choice is missing. On head all three choices are listed. The outgoingsession/set_config_optionvalues are["example", "_t3/empty", ""], and the descriptor's current value follows each pick.packages/provider-acp,vp test run src/server/sessionConfig.test.ts -t "literal _t3/empty". The option advertises""/Auto,_t3/emptyand_t3/empty/literal(both with blank names), with_t3/emptycurrent. On base_t3/emptyis dropped and Auto shows as current. On head all three choices are kept with distinct IDs, labels fall back to the native values, and Literal is current.mainalready sends every such string except_t3/emptyunchanged. So no ID is left over for the literal choice: whatever ID it gets, one raw string must change meaning, just asmainalready reserves_t3/emptyfor"". This PR reserves exactly one more string, which is 257 characters long. Discovery can never offer it, so it can only arrive if typed by hand. Every other raw value, including_t3/empty/literal, is still sent unchanged no matter which choices the agent advertises later. A per-session encoding would avoid reserving a string but lets saved IDs change meaning (round 1 finding), and a separate alias field would need a contract change beyond this fix.main; this PR leaves that order unchanged.commit-checked.sh --amend→vp run check:changedexit 0: format, lint, knip, typecheck (13 packages) and tests (4 files) all pass. The full log is attached to the gist.check:changedlog for6f712d7b9855: https://gist.github.com/saphid/f1273b3cd3fd5221aeb5f5ab6b9dc024Not shown: no
scenarios:proverun or picker screenshots. Clients render the server descriptor unchanged. To reproduce in the app, add a Local ACP provider whose command isnode apps/server/scripts/acp-mock-agent.ts, with envT3_ACP_EMIT_EMPTY_DEFAULT_AGENT_OPTION=1. Open a thread on it, open the model picker's Agent control, pick Literal and send a turn; the mock setscurrentAgentto the value it receives. That flow was not driven here, and no real third-party ACP agent was used.Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown