fix(chat): settle authoritative turns and make capabilities explicit

This commit is contained in:
2026-10-20 15:45:09 +01:00
parent 016fcb552a
commit e504780976
16 changed files with 615 additions and 56 deletions
+8 -2
View File
@@ -179,6 +179,10 @@ type ChatModelRequest struct {
// lifted to Directory, CreatedAt and UpdatedAt.
type ChatSession struct {
ID string `json:"id"`
// InstructionStatus is the observed create-time preload outcome: applied,
// unsupported, failed, or not_requested. Ordinary list rows omit it.
InstructionStatus string `json:"instruction_status,omitempty"`
InstructionError string `json:"instruction_error,omitempty"`
// Backend names the harness that owns this session: opencode, codex or
// claude. Empty on older peers and for legacy OpenCode rows.
Backend string `json:"backend,omitempty"`
@@ -238,8 +242,8 @@ type ChatCreateRequest struct {
Backend string `json:"backend,omitempty"`
OperationID string `json:"operation_id,omitempty"`
// Instructions preloads the session's durable behavior instruction, when the
// harness supports session instruction entries (OpenCode does). Best effort:
// a harness without the surface still creates the chat.
// harness supports session instruction entries (OpenCode does). The reply's
// instruction_status explicitly reports applied, unsupported or failed.
Instructions string `json:"instructions,omitempty"`
// Ephemeral creates a chat for automated verification: the session is created,
// bootstrapped and usable exactly like a normal one, but no operator-registry
@@ -435,6 +439,8 @@ type ChatEventFrame struct {
type ChatStep struct {
Status string `json:"status"`
Index int `json:"index,omitempty"`
// Intermediate distinguishes a provider step from authoritative turn completion.
Intermediate bool `json:"intermediate,omitempty"`
}
// ChatUsage is the token and cost total of a turn.