Skip to content

feat(go/plugins/anthropic): register latest Claude models#5519

Draft
adesinah wants to merge 1 commit into
mainfrom
feat/claude-opus-models
Draft

feat(go/plugins/anthropic): register latest Claude models#5519
adesinah wants to merge 1 commit into
mainfrom
feat/claude-opus-models

Conversation

@adesinah

Copy link
Copy Markdown
Contributor

This PR registers latest Claude models (opus 4.8/4.7/…) for Go↔JS parity.

Closes: #5494

Checklist (if applicable):

@github-actions github-actions Bot added the go label Jun 11, 2026
@adesinah adesinah marked this pull request as draft June 11, 2026 10:06

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request centralizes the configuration of Claude model capabilities by introducing a shared modelOptions helper, mirroring the JS plugin's KNOWN_MODELS. It maps curated models to advanced capabilities (such as JSON output support) and integrates this helper into both ListActions and ResolveAction. Additionally, new tests and sample flows have been added to verify and demonstrate these capabilities. The review feedback points out an issue where versioned model IDs containing a date suffix (e.g., -YYYYMMDD) will fail the lookup in knownModels and fall back to default options, thereby losing their curated capabilities. A code suggestion is provided to strip this suffix before performing the lookup.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +109 to +118
func modelOptions(name string) ai.ModelOptions {
opts, ok := knownModels[name]
if !ok {
opts = defaultClaudeOpts
}
if opts.Label == "" {
opts.Label = fmt.Sprintf("%s - %s", anthropicLabelPrefix, name)
}
return opts
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

When a user requests a model using its fully-qualified versioned ID (e.g., claude-opus-4-5-20251101), modelOptions looks up the full versioned ID in knownModels. Since knownModels only contains the unversioned aliases (e.g., claude-opus-4-5), the lookup fails and falls back to defaultClaudeOpts. This means versioned model IDs will not receive their curated capabilities (such as JSON output support).

To fix this, we should strip the 8-digit date suffix (e.g., -YYYYMMDD) from the model name before looking it up in knownModels.

func modelOptions(name string) ai.ModelOptions {
	baseName := name
	if len(name) >= 9 && name[len(name)-9] == '-' {
		isDate := true
		for i := len(name) - 8; i < len(name); i++ {
			if name[i] < '0' || name[i] > '9' {
				isDate = false
				break
			}
		}
		if isDate {
			baseName = name[:len(name)-9]
		}
	}

	opts, ok := knownModels[baseName]
	if !ok {
		opts = defaultClaudeOpts
	}
	if opts.Label == "" {
		opts.Label = fmt.Sprintf("%s - %s", anthropicLabelPrefix, name)
	}
	return opts
}

@adesinah adesinah changed the title feat(go/plugins/anthropic): register latest Claude models feat(go/plugins/anthropic): register latest Claude models Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(go/plugins/anthropic): register Claude Opus 4.7/4.8 models

1 participant