Skip to content

fix(acp): keep an empty config choice distinct from a literal _t3/empty value - #46727

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-011c6e9d11
Dec 1, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-011c6e9d11

Conversation

@saphid

@saphid saphid commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Problem

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.
  • Transcript, focused results and full check:changed log for 6f712d7b9855: https://gist.github.com/saphid/f1273b3cd3fd5221aeb5f5ab6b9dc024

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.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Dec 1, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at c6239de

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.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · previous review c6239

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 03e9365 and c6239de.

Files selected for processing: 5

  • apps/server/scripts/acp-mock-agent.ts
  • apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
  • packages/provider-acp/src/server/adapter.ts
  • packages/provider-acp/src/server/sessionConfig.test.ts
  • packages/provider-acp/src/server/sessionConfig.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 1, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

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

Proven: the scenario fails on base ed721f7fb8 and passes on head e3e520f9a0.

Base ed721f7fb8 Head e3e520f9a0
Result ❌ failed
ASSERTION_FAILED: expect.toBeVisible failed
locator: getByRole("menuitemradio", name: "Literal")
expected: visible
observed: no node (match count 0)
✅ passed
agent choices current literal Base ed721f7fb8: agent choices current literal Head e3e520f9a0: agent choices current literal
failure Base ed721f7fb8: failure
selected example Head e3e520f9a0: selected example
selected Copilot Head e3e520f9a0: selected Copilot
selected Literal Head e3e520f9a0: selected Literal
Recording Before After
Real app flow Before recording After recording

Scenario driver

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.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 1, 2026
@juliusmarminge
juliusmarminge merged commit 0ea92c4 into pingdotgg:main Dec 1, 2026
59 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 1, 2026
imetn added a commit to imetn/t4code that referenced this pull request Dec 2, 2026
… and provider fixes

Ported 20 upstream commits (Batch 2 server/migrations/search/multi-repo + Batch 3A provider fixes): pingdotgg#46474, pingdotgg#46905, pingdotgg#46901, pingdotgg#46571, pingdotgg#46532, pingdotgg#46545, pingdotgg#46740, pingdotgg#47038, pingdotgg#47027, pingdotgg#47109, pingdotgg#46654, pingdotgg#46488, pingdotgg#46492, pingdotgg#46667, pingdotgg#46727, pingdotgg#46841, pingdotgg#46880, pingdotgg#47123, pingdotgg#47152, pingdotgg#47139. Preserved all locked T4 customizations including Lock pingdotgg#11 Antigravity promptRefusedWhileAgentWaits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants