Compare commits

...

3 Commits

Author SHA1 Message Date
Ed Zynda 3d0f3358cb feat: Update model aliases for Anthropic, OpenAI, and Google Gemini
Update model aliases to point to latest versions based on models.dev:

Anthropic:
- claude-opus-latest, claude-4-opus-latest -> claude-opus-4-6
- claude-sonnet-latest, claude-4-sonnet-latest -> claude-sonnet-4-6
- Add claude-haiku-latest, claude-4-haiku-latest -> claude-haiku-4-5
- Keep existing 3.x aliases

OpenAI (new):
- o1-latest -> o1, o3-latest -> o3, o4-latest -> o4-mini
- gpt-5-latest, gpt-5-chat-latest -> gpt-5.4
- gpt-4-latest, gpt-4 -> gpt-4o
- gpt-3.5-latest, gpt-3.5 -> gpt-3.5-turbo
- codex-latest -> codex-mini-latest

Google Gemini (new):
- gemini-pro-latest, gemini-pro -> gemini-2.5-pro
- gemini-flash-latest, gemini-flash -> gemini-2.5-flash

Also update README and www documentation to reflect new aliases and
update default model references to use claude-sonnet-latest alias.
2026-03-20 14:01:22 +03:00
Ed Zynda 25da02fa65 docs: add extensions/testing page to navigation 2026-03-20 13:48:21 +03:00
Ed Zynda 4ae03aab7c refactor: move extension testing package to pkg/
Move the extension testing package from internal/extensions/test to
pkg/extensions/test to make it publicly importable by external extension
authors.

Changes:
- Moved test package files to pkg/extensions/test/
- Updated all imports from internal/ to pkg/ path:
  - README.md
  - examples/extensions/tool-logger_test.go
  - examples/extensions/extension_test_template.go
  - skills/kit-extensions/SKILL.md
  - www/pages/extensions/testing.md
  - pkg/extensions/test/README.md
  - pkg/extensions/test/harness.go

The test package is now available for external import as:
  github.com/mark3labs/kit/pkg/extensions/test

All tests pass with race detector.
2026-03-20 13:40:15 +03:00
19 changed files with 118 additions and 45 deletions
+30 -9
View File
@@ -72,7 +72,7 @@ kit @main.go @test.go "Review these files"
kit --continue
# Use specific model
kit --model anthropic/claude-sonnet-4-5-20250929
kit --model anthropic/claude-sonnet-latest
```
### Non-Interactive Mode
@@ -116,7 +116,7 @@ Kit looks for configuration in the following locations (in order of priority):
Create `~/.kit.yml`:
```yaml
model: anthropic/claude-sonnet-4-5-20250929
model: anthropic/claude-sonnet-latest
max-tokens: 4096
temperature: 0.7
stream: true
@@ -362,7 +362,7 @@ package main
import (
"testing"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
"github.com/mark3labs/kit/internal/extensions"
)
@@ -657,7 +657,7 @@ npm/ - NPM package wrapper for distribution
```bash
provider/model # Standard format
anthropic/claude-sonnet-4-5-20250929
anthropic/claude-sonnet-latest
openai/gpt-4o
ollama/llama3
google/gemini-2.0-flash-exp
@@ -666,14 +666,35 @@ google/gemini-2.0-flash-exp
### Model Aliases
```bash
claude-opus-latest → claude-opus-4-20250514
claude-sonnet-latest → claude-sonnet-4-5-20250929
claude-4-opus-latest → claude-opus-4-20250514
claude-4-sonnet-latest → claude-sonnet-4-5-20250929
# Anthropic Claude
claude-opus-latest → claude-opus-4-6
claude-sonnet-latest → claude-sonnet-4-6
claude-haiku-latest → claude-haiku-4-5
claude-4-opus-latest → claude-opus-4-6
claude-4-sonnet-latest → claude-sonnet-4-6
claude-4-haiku-latest → claude-haiku-4-5
claude-3-7-sonnet-latest → claude-3-7-sonnet-20250219
claude-3-5-sonnet-latest → claude-3-5-sonnet-20241022
claude-3-5-sonnet-latest → claude-3-5-sonnet-20241022
claude-3-5-haiku-latest → claude-3-5-haiku-20241022
claude-3-opus-latest → claude-3-opus-20240229
# OpenAI GPT
o1-latest → o1
o3-latest → o3
o4-latest → o4-mini
gpt-5-latest → gpt-5.4
gpt-5-chat-latest → gpt-5.4
gpt-4-latest → gpt-4o
gpt-4 → gpt-4o
gpt-3.5-latest → gpt-3.5-turbo
gpt-3.5 → gpt-3.5-turbo
codex-latest → codex-mini-latest
# Google Gemini
gemini-pro-latest → gemini-2.5-pro
gemini-flash-latest → gemini-2.5-flash
gemini-flash → gemini-2.5-flash
gemini-pro → gemini-2.5-pro
```
## Contributing
@@ -15,7 +15,7 @@ import (
"testing"
"github.com/mark3labs/kit/internal/extensions"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
)
// Test that your extension loads without errors
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"testing"
"github.com/mark3labs/kit/internal/extensions"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
)
// Test that the tool-logger extension loads and registers handlers
+30 -7
View File
@@ -37,15 +37,38 @@ func resolveModelAlias(provider, modelName string) string {
registry := GetGlobalRegistry()
aliasMap := map[string]string{
"claude-opus-latest": "claude-opus-4-20250514",
"claude-sonnet-latest": "claude-sonnet-4-5-20250929",
"claude-4-opus-latest": "claude-opus-4-20250514",
"claude-4-sonnet-latest": "claude-sonnet-4-5-20250929",
// Anthropic aliases
"claude-opus-latest": "claude-opus-4-6",
"claude-sonnet-latest": "claude-sonnet-4-6",
"claude-haiku-latest": "claude-haiku-4-5",
"claude-4-opus-latest": "claude-opus-4-6",
"claude-4-sonnet-latest": "claude-sonnet-4-6",
"claude-4-haiku-latest": "claude-haiku-4-5",
"claude-3-5-haiku-latest": "claude-3-5-haiku-20241022",
"claude-3-5-sonnet-latest": "claude-3-5-sonnet-20241022",
"claude-3-7-sonnet-latest": "claude-3-7-sonnet-20250219",
"claude-3-opus-latest": "claude-3-opus-20240229",
// OpenAI aliases
"gpt-5-latest": "gpt-5.4",
"gpt-5-chat-latest": "gpt-5.4",
"gpt-4-latest": "gpt-4o",
"gpt-4": "gpt-4o",
"gpt-3.5": "gpt-3.5-turbo",
"gpt-3.5-latest": "gpt-3.5-turbo",
"o1-latest": "o1",
"o3-latest": "o3",
"o4-latest": "o4-mini",
"codex-latest": "codex-mini-latest",
// Google Gemini aliases
"gemini-pro-latest": "gemini-2.5-pro",
"gemini-flash": "gemini-2.5-flash",
"gemini-pro": "gemini-2.5-pro",
"gemini-2-flash": "gemini-2.0-flash",
"gemini-2-pro": "gemini-2.5-pro",
"gemini-1.5-flash": "gemini-1.5-flash",
"gemini-1.5-pro": "gemini-1.5-pro",
}
if resolved, exists := aliasMap[modelName]; exists {
@@ -180,8 +203,8 @@ func CreateProvider(ctx context.Context, config *ProviderConfig) (*ProviderResul
return nil, err
}
// Resolve model aliases (for OAuth compatibility)
if provider == "anthropic" || provider == "google-vertex-anthropic" {
// Resolve model aliases to full model names
if provider == "anthropic" || provider == "google-vertex-anthropic" || provider == "openai" || provider == "google" {
modelName = resolveModelAlias(provider, modelName)
}
@@ -1,6 +1,6 @@
# Testing Kit Extensions
The `github.com/mark3labs/kit/internal/extensions/test` package provides utilities for testing Kit extensions using standard Go testing patterns.
The `github.com/mark3labs/kit/pkg/extensions/test` package provides utilities for testing Kit extensions using standard Go testing patterns.
## Overview
@@ -18,7 +18,7 @@ The test package is part of the Kit codebase. Import it in your extension tests:
```go
import (
"testing"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
"github.com/mark3labs/kit/internal/extensions"
)
```
@@ -32,7 +32,7 @@ package main
import (
"testing"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
"github.com/mark3labs/kit/internal/extensions"
)
@@ -336,7 +336,7 @@ package main
import (
"testing"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
"github.com/mark3labs/kit/internal/extensions"
)
@@ -10,7 +10,7 @@
//
// import (
// "testing"
// "github.com/mark3labs/kit/internal/extensions/test"
// "github.com/mark3labs/kit/pkg/extensions/test"
// )
//
// func TestMyExtension(t *testing.T) {
+2 -2
View File
@@ -930,7 +930,7 @@ package main
import (
"testing"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
"github.com/mark3labs/kit/internal/extensions"
)
@@ -1216,6 +1216,6 @@ func applyMode(ctx ext.Context, active bool, tools []string) {
- [`internal/extensions/runner.go`](https://github.com/mark3labs/kit/blob/main/internal/extensions/runner.go) — Event dispatch and state management
- [`internal/extensions/loader.go`](https://github.com/mark3labs/kit/blob/main/internal/extensions/loader.go) — Yaegi interpreter setup
- [`internal/extensions/symbols.go`](https://github.com/mark3labs/kit/blob/main/internal/extensions/symbols.go) — All types exported to extensions
- [`internal/extensions/test/`](https://github.com/mark3labs/kit/tree/main/internal/extensions/test) — Testing package with harness, mocks, and assertions
- [`pkg/extensions/test/`](https://github.com/mark3labs/kit/tree/main/pkg/extensions/test) — Testing package with harness, mocks, and assertions
- [`examples/extensions/tool-logger_test.go`](https://github.com/mark3labs/kit/blob/main/examples/extensions/tool-logger_test.go) — Complete test example
- [`examples/extensions/`](https://github.com/mark3labs/kit/tree/main/examples/extensions) — 25+ working example extensions
+1 -1
View File
@@ -16,7 +16,7 @@ kit "Explain main.go" --json --quiet --no-session
```json
{
"response": "Final assistant response text",
"model": "anthropic/claude-haiku-3-5-20241022",
"model": "anthropic/claude-haiku-latest",
"stop_reason": "end_turn",
"session_id": "a1b2c3d4e5f6",
"usage": {
+4 -4
View File
@@ -17,7 +17,7 @@ kit "Analyze codebase" \
--no-session \
--no-extensions \
--quiet \
--model anthropic/claude-haiku-3-5-20241022
--model anthropic/claude-haiku-latest
```
Key flags for subprocess usage:
@@ -39,7 +39,7 @@ Kit includes a built-in `spawn_subagent` tool that the LLM can use to delegate t
```
spawn_subagent(
task: "Analyze the test files and summarize coverage",
model: "anthropic/claude-haiku-3-5-20241022", // optional
model: "anthropic/claude-haiku-latest", // optional
system_prompt: "You are a test analysis expert.", // optional
timeout_seconds: 300 // optional, max 1800
)
@@ -54,7 +54,7 @@ Extensions can spawn subagents programmatically:
```go
result := ctx.SpawnSubagent(ext.SubagentConfig{
Task: "Review this code for security issues",
Model: "anthropic/claude-sonnet-4-5-20250929",
Model: "anthropic/claude-sonnet-latest",
SystemPrompt: "You are a security auditor.",
})
```
@@ -66,7 +66,7 @@ The SDK provides in-process subagent spawning:
```go
result, err := host.Subagent(ctx, kit.SubagentConfig{
Task: "Summarize the changes in this PR",
Model: "anthropic/claude-haiku-3-5-20241022",
Model: "anthropic/claude-haiku-latest",
SystemPrompt: "You are a code reviewer.",
Timeout: 5 * time.Minute,
})
+1 -1
View File
@@ -11,7 +11,7 @@ All flags can be passed to the root `kit` command.
| Flag | Short | Default | Description |
|------|-------|---------|-------------|
| `--model` | `-m` | `anthropic/claude-sonnet-4-5-20250929` | Model to use (provider/model format) |
| `--model` | `-m` | `anthropic/claude-sonnet-latest` | Model to use (provider/model format) |
| `--provider-api-key` | — | — | API key for the provider |
| `--provider-url` | — | — | Base URL for provider API |
| `--tls-skip-verify` | — | `false` | Skip TLS certificate verification |
+2 -2
View File
@@ -17,7 +17,7 @@ Kit looks for configuration in the following locations, in order of priority:
Create `~/.kit.yml`:
```yaml
model: anthropic/claude-sonnet-4-5-20250929
model: anthropic/claude-sonnet-latest
max-tokens: 4096
temperature: 0.7
stream: true
@@ -27,7 +27,7 @@ stream: true
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `model` | string | `anthropic/claude-sonnet-4-5-20250929` | Model to use (provider/model format) |
| `model` | string | `anthropic/claude-sonnet-latest` | Model to use (provider/model format) |
| `max-tokens` | int | `4096` | Maximum tokens in response |
| `temperature` | float | `0.7` | Randomness 0.01.0 |
| `top-p` | float | `0.95` | Nucleus sampling 0.01.0 |
+1 -1
View File
@@ -227,7 +227,7 @@ Spawn in-process child Kit instances:
```go
result := ctx.SpawnSubagent(ext.SubagentConfig{
Task: "Analyze the test files and summarize coverage",
Model: "anthropic/claude-haiku-3-5-20241022",
Model: "anthropic/claude-haiku-latest",
SystemPrompt: "You are a test analysis expert.",
})
```
+3 -3
View File
@@ -5,7 +5,7 @@ description: Write unit tests for your Kit extensions using the test package.
# Testing Extensions
Kit provides a testing package (`github.com/mark3labs/kit/internal/extensions/test`) that enables you to write unit tests for your extensions. Tests run outside the Yaegi interpreter but load your extension code into an isolated interpreter instance, allowing you to verify behavior without running the full Kit TUI.
Kit provides a testing package (`github.com/mark3labs/kit/pkg/extensions/test`) that enables you to write unit tests for your extensions. Tests run outside the Yaegi interpreter but load your extension code into an isolated interpreter instance, allowing you to verify behavior without running the full Kit TUI.
## Overview
@@ -25,7 +25,7 @@ The test package is part of the Kit codebase. Import it in your extension tests:
```go
import (
"testing"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
"github.com/mark3labs/kit/internal/extensions"
)
```
@@ -41,7 +41,7 @@ package main
import (
"testing"
"github.com/mark3labs/kit/internal/extensions/test"
"github.com/mark3labs/kit/pkg/extensions/test"
"github.com/mark3labs/kit/internal/extensions"
)
+35 -7
View File
@@ -26,27 +26,55 @@ Kit supports a wide range of LLM providers through a unified `provider/model` st
```bash
provider/model # Standard format
anthropic/claude-sonnet-4-5-20250929
anthropic/claude-sonnet-latest
openai/gpt-4o
ollama/llama3
google/gemini-2.0-flash-exp
google/gemini-2.5-flash
```
## Model aliases
Kit provides aliases for commonly used models:
### Anthropic Claude
```bash
claude-opus-latest → claude-opus-4-20250514
claude-sonnet-latest → claude-sonnet-4-5-20250929
claude-4-opus-latest → claude-opus-4-20250514
claude-4-sonnet-latest → claude-sonnet-4-5-20250929
claude-opus-latest → claude-opus-4-6
claude-sonnet-latest → claude-sonnet-4-6
claude-haiku-latest → claude-haiku-4-5
claude-4-opus-latest → claude-opus-4-6
claude-4-sonnet-latest → claude-sonnet-4-6
claude-4-haiku-latest → claude-haiku-4-5
claude-3-7-sonnet-latest → claude-3-7-sonnet-20250219
claude-3-5-sonnet-latest → claude-3-5-sonnet-20241022
claude-3-5-haiku-latest → claude-3-5-haiku-20241022
claude-3-opus-latest → claude-3-opus-20240229
```
### OpenAI GPT
```bash
o1-latest → o1
o3-latest → o3
o4-latest → o4-mini
gpt-5-latest → gpt-5.4
gpt-5-chat-latest → gpt-5.4
gpt-4-latest → gpt-4o
gpt-4 → gpt-4o
gpt-3.5-latest → gpt-3.5-turbo
gpt-3.5 → gpt-3.5-turbo
codex-latest → codex-mini-latest
```
### Google Gemini
```bash
gemini-pro-latest → gemini-2.5-pro
gemini-flash-latest → gemini-2.5-flash
gemini-flash → gemini-2.5-flash
gemini-pro → gemini-2.5-pro
```
## Specifying a model
Via CLI flag:
@@ -59,7 +87,7 @@ kit -m ollama/llama3
Via config file:
```yaml
model: anthropic/claude-sonnet-4-5-20250929
model: anthropic/claude-sonnet-latest
```
Via environment variable:
+1 -1
View File
@@ -28,7 +28,7 @@ kit @main.go @test.go "Review these files"
Use a specific model:
```bash
kit --model anthropic/claude-sonnet-4-5-20250929
kit --model anthropic/claude-sonnet-latest
```
## Non-interactive mode
+1
View File
@@ -34,6 +34,7 @@ export default {
"extensions/capabilities",
"extensions/examples",
"extensions/loading",
"extensions/testing",
],
},
{