Skip to content

Conversation

@validatedev
Copy link

@validatedev validatedev commented Jan 17, 2026

What does this PR do?

Fixes #8973 by exposing thinking variants in ACP model selection:

  • Appends model+variant entries (e.g., claude-sonnet-4/high) to models.availableModels
  • Parses variant from session/set_model selections and keeps session variant in sync
  • Returns proper variant metadata via _meta (modelId, variant, availableVariants) instead of empty object
  • Updated @agentclientprotocol/sdk to 0.13.0

How did you verify your code works?

  • bun run typecheck
  • Zed exposes thinking variants via model selector
  • Verified session/set_model responses include correct _meta.opencode with variant info

Screenshot

CleanShot 2026-01-17 at 12 59 39@2x

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

"description": "AI-powered development tool",
"private": true,
"type": "module",
"packageManager": "[email protected].5",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we revert this? There is a reason we havent upgraded bun yet :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure! And I'll resolve other style-related problems too, working on it

@rekram1-node
Copy link
Collaborator

/review

directory: string,
sessionId: string,
): Promise<{ availableModes: ModeOption[]; currentModeId?: string }> {
const availableModes = await this.loadAvailableModes(directory)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style guide suggestion: This let statement could potentially be refactored to avoid mutation. Consider using an IIFE or ternary if the logic can be simplified. However, given the async defaultAgent() call inside the conditional, this may be acceptable as-is since the complexity of alternatives might outweigh the benefit.


const providers = await this.sdk.config.providers({ directory }).then((x) => x.data!.providers)
const entries = sortProvidersByName(providers)
const availableVariants = modelVariantsFromProviders(entries, model)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style guide note: Destructuring like const { availableModes, currentModeId } = ... goes against the style guide recommendation to avoid unnecessary destructuring. You could use const modeState = await this.resolveModeState(...) and access modeState.availableModes and modeState.currentModeId to preserve context. This is just a suggestion - feel free to keep as-is if you prefer the readability here.

async unstable_setSessionModel(params: SetSessionModelRequest) {
const session = this.sessionManager.get(params.sessionId)
const providers = await this.sdk.config
.providers({ directory: session.cwd }, { throwOnError: true })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style guide note: Same as above - destructuring const { model, variant } = ... could be const selection = parseModelSelection(...) with selection.model and selection.variant. Just a suggestion for consistency with style guide.

@rekram1-node
Copy link
Collaborator

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zed OpenCode ACP thinking variants cannot be accessible

2 participants