The Continue configuration says what the catalog says of the model
CI / test (push) Successful in 2m52s
CI / test (push) Successful in 2m52s
It told Continue every model uses tools and nothing of its context: a model whose calls come back as text stalled Continue's agent, and Continue sent prompts far over a CPU replica's 4096 tokens, each refused. tool_use is now written for a model whose catalog entry says tools, and the context length with a fitting maxTokens whenever the catalog knows it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ef33e52d3d
commit
df6d243ee7
5 files changed
+82
-18
No files matched your search
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func TestEachToolGetsItsConfigurationWithTheKey(t *testing.T) {
|
||||
c := connectFor("continue", "https://gw.example", "qwen2.5-coder-7b", "sk-llmgw-abc")
|
||||
c := connectFor("continue", "https://gw.example", "qwen2.5-coder-7b", "sk-llmgw-abc", ModelFacts{})
|
||||
if !strings.Contains(c.Files[0].Body, "apiBase: https://gw.example/v1") || !strings.Contains(c.Files[0].Body, "apiKey: sk-llmgw-abc") ||
|
||||
c.Files[0].Path != "~/.continue/assistants/llmgw.yaml" {
|
||||
t.Errorf("continue = %+v", c.Files)
|
||||
@@ -21,11 +21,11 @@ func TestEachToolGetsItsConfigurationWithTheKey(t *testing.T) {
|
||||
if strings.Contains(strings.Split(c.Command, "|")[0], "sk-llmgw-abc") {
|
||||
t.Errorf("the key is in the URL: %s", c.Command)
|
||||
}
|
||||
x := connectFor("codex", "https://gw.example", "qwen2.5-coder-7b", "sk-llmgw-abc")
|
||||
x := connectFor("codex", "https://gw.example", "qwen2.5-coder-7b", "sk-llmgw-abc", ModelFacts{})
|
||||
if strings.Contains(x.Files[0].Body, "sk-llmgw-abc") || !strings.Contains(x.Files[0].Body, `env_key = "LLMGW_API_KEY"`) {
|
||||
t.Errorf("codex writes the key into its file: %s", x.Files[0].Body)
|
||||
}
|
||||
cl := connectFor("cline", "https://gw.example", "m", "sk-llmgw-abc")
|
||||
cl := connectFor("cline", "https://gw.example", "m", "sk-llmgw-abc", ModelFacts{})
|
||||
if len(cl.Fields) != 4 || cl.Fields[1].Value != "https://gw.example/v1" || cl.Command != "" {
|
||||
t.Errorf("cline = %+v", cl)
|
||||
}
|
||||
@@ -115,3 +115,23 @@ func TestASetupScriptRefusesANameAShellWouldRead(t *testing.T) {
|
||||
t.Errorf("%d", w.Code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContinueIsToldTheModelsContextAndWhetherItCanUseTools(t *testing.T) {
|
||||
// Told a context far larger than the gateway allows, Continue sends
|
||||
// prompts that are refused; told a model uses tools when its calls come
|
||||
// back as text, its agent stalls.
|
||||
agent := continueYAML("https://gw.example", "coder-30b", "k", ModelFacts{ContextLength: 32768, Tools: true})
|
||||
for _, want := range []string{"tool_use", "contextLength: 32768", "maxTokens: 4096"} {
|
||||
if !strings.Contains(agent, want) {
|
||||
t.Errorf("%q missing:\n%s", want, agent)
|
||||
}
|
||||
}
|
||||
chat := continueYAML("https://gw.example", "coder", "k", ModelFacts{ContextLength: 4096})
|
||||
if strings.Contains(chat, "tool_use") || !strings.Contains(chat, "contextLength: 4096") ||
|
||||
!strings.Contains(chat, "maxTokens: 1024") || !strings.Contains(chat, "its agent cannot act") {
|
||||
t.Errorf("a model without tools:\n%s", chat)
|
||||
}
|
||||
if unknown := continueYAML("https://gw.example", "m", "k", ModelFacts{}); strings.Contains(unknown, "contextLength") {
|
||||
t.Errorf("a context nobody knows was written down:\n%s", unknown)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user