usage: an OpenCode session's row shows the effort and the model it asked for (#680, Sun1090: 数据不完整,推理强度是有的)
OpenCode rows read from its own data (opencode.db or storage/) had 请求模型 and 推理强度 as —. OpenCode keeps both on each reply (packages/schema/src/v1/session.ts, AssistantMessage): variant, the effort picked in its model menu for the prompt (high, max, low, xhigh, none, thinking … as the provider's variants name them; prompt.ts copies lastUser.model.variant onto every reply), and modelID, the model the reply was sent to. OpenCode 2 (session_message) keeps the variant in model.variant (Model.Ref). It records no model the response named, so modelID is what was asked for, as a Codex rollout's model is.
Now a call's Effort is the reply's variant ("default" or none is no effort picked); a compaction in OpenCode 2 takes the effort last replied with, as it takes the model. In the ledger an OpenCode call is told as a Codex one: requested = its model, served left empty rather than claimed. The call cache moves to calls-v5 so calls read before carry the effort.
TestOpenCodeCallsJSON/DB/V2 (fixtures with variant high, default, xhigh and none) and TestOpenCodeSessionCallIsWhatItAskedFor fail on the old code and pass. go vet ./internal/..., builds (nogui, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried against a real OpenCode database with variants (this machine's OpenCode data predates them).
This commit is contained in:
Vendored
+2
-1
@@ -8,6 +8,7 @@
|
||||
"agent": "build",
|
||||
"model": {
|
||||
"providerID": "openai",
|
||||
"modelID": "gpt-6-astra"
|
||||
"modelID": "gpt-6-astra",
|
||||
"variant": "high"
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -25,5 +25,6 @@
|
||||
"created": 1790416806000,
|
||||
"completed": 1790416830000
|
||||
},
|
||||
"variant": "high",
|
||||
"finish": "tool-calls"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user