Skip to content

fix(cli): wait for consistent ACP model choices - #46613

Merged
kitlangton merged 1 commit into
v2from
acp-model-choices
Sep 2, 2026
Merged

fix(cli): wait for consistent ACP model choices#46613
kitlangton merged 1 commit into
v2from
acp-model-choices

Conversation

@kitlangton

@kitlangton kitlangton commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Why

ACP can return an empty or incomplete model menu on startup even though its default model is available. The model list and default are read in parallel, so they can straddle plugin activation. The previous loader accepted the ready default and cached the older list.

What Changes

Resolve the preferred default from the same enabled-model list used to build ACP's choices. If that list is empty or does not yet contain the default, use the existing retry loop instead of caching an inconsistent catalog.

Startup Responses Before After
Empty model list, ready default Cache an empty menu Retry the catalog read
Partial list missing the default Advertise choices that omit the current model Retry the catalog read
Consistent list and default Use the catalog Unchanged
No preferred default Choose the first enabled model Unchanged

Scope

Independent ACP bug fix extracted from #46496. The retry budget and catalog-sharing behavior are unchanged; no SDK instance-selection dependency.

The former shared build prerequisite landed independently in 43d09b9d75; this PR now targets v2 directly.

Verification

Using Bun 1.4.0, from packages/cli:

bun typecheck
bun run test test/acp/service-directory.test.ts test/acp/config-options.subprocess.test.ts
bun run test

After rebasing onto v2 at e2e82f18e2, the full CLI suite passed 264 tests and the ACP service-directory/subprocess slice passed 10 tests. Range-diff confirms the two-file patch is unchanged. Both deterministic regressions failed before the fix when first introduced.

CLI typechecking, formatting, and diff checks passed. The normal pre-push workspace typecheck passed all 33 tasks.

The previous head's CI passed Windows and the Linux unit suites; its only failure was the generated-documentation check, which upstream fixed in #46678. Rebased again onto v2 at c8f81c8b83 with an identical patch; the ACP service-directory and subprocess tests passed 10/10 and CLI typechecking passed.

@kitlangton
kitlangton changed the base branch from activation-check to v2 September 1, 2026 15:46
Resolve the default against the same enabled model list before caching the catalog. Parallel startup reads can otherwise retain an empty or incomplete model menu.
@kitlangton
kitlangton merged commit 95d788f into v2 Sep 2, 2026
10 checks passed
@kitlangton
kitlangton deleted the acp-model-choices branch September 2, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant