fix: scope OpenAI reasoning rejection epochs to their source
A rejection advanced the epoch for every model and credential on the provider, although the rejected request only replayed reasoning from its own model and credential. Switching back to another model, or from a personal key back to the deployment's credential, then dropped reasoning that was still valid. Each provider, model, and credential now has its own epochs. A retried step that returned no reasoning also lost the new epoch, so the next step replayed the rejected reasoning and was rejected again. Such a step now records the epoch on its first part.
This commit is contained in:
1 parent
5fb3ce1689
commit
62b5cb532a
10 files changed
+185
-131
No files matched your search
Generated
+1
-1
@@ -21338,7 +21338,7 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
},
|
||||
"reasoning_epoch": {
|
||||
"description": "ReasoningEpoch records how many times the producing provider had\nrejected the chat's encrypted reasoning before this reasoning part\nwas produced. Internal only: stripped before API responses.",
|
||||
"description": "ReasoningEpoch records how many times the provider had rejected the\nchat's encrypted reasoning from this provider, model, and credential\nbefore this reasoning part was produced. A step that produced no\nreasoning after a rejection records its epoch, provider, model, and\ncredential on its first part instead. Internal only: stripped before\nAPI responses.",
|
||||
"type": "integer"
|
||||
},
|
||||
"result": {
|
||||
|
||||
Generated
+1
-1
@@ -19268,7 +19268,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"reasoning_epoch": {
|
||||
"description": "ReasoningEpoch records how many times the producing provider had\nrejected the chat's encrypted reasoning before this reasoning part\nwas produced. Internal only: stripped before API responses.",
|
||||
"description": "ReasoningEpoch records how many times the provider had rejected the\nchat's encrypted reasoning from this provider, model, and credential\nbefore this reasoning part was produced. A step that produced no\nreasoning after a rejection records its epoch, provider, model, and\ncredential on its first part instead. Internal only: stripped before\nAPI responses.",
|
||||
"type": "integer"
|
||||
},
|
||||
"result": {
|
||||
|
||||
@@ -334,8 +334,8 @@ func (server *Server) prepareGeneration(
|
||||
|
||||
// Drop provider-executed tool history produced by a different provider,
|
||||
// and OpenAI reasoning state produced by a different provider, model,
|
||||
// or credential, or before the provider's latest rejection of the
|
||||
// chat's encrypted reasoning, before building the prompt. A provider
|
||||
// or credential, or before the latest rejection of that source's
|
||||
// encrypted reasoning, before building the prompt. A provider
|
||||
// that shares another's wire format (e.g. Bedrock and Anthropic) can
|
||||
// still reject the other's provider-specific blocks, so a mid-chat
|
||||
// provider switch must not replay them.
|
||||
@@ -351,7 +351,7 @@ func (server *Server) prepareGeneration(
|
||||
// sanitizing everything, since the tail is user-only and the
|
||||
// sanitizer only rewrites assistant rows.
|
||||
pendingRowsStart := pendingUserSegmentStart(promptRows)
|
||||
reasoningSource.Epoch = currentReasoningEpoch(promptRows[:pendingRowsStart], providerIdentity)
|
||||
reasoningSource.Epoch = currentReasoningEpoch(promptRows[:pendingRowsStart], reasoningSource)
|
||||
sanitizedHead, err := server.sanitizeForeignProviderStateRows(ctx, logger, promptRows[:pendingRowsStart], chat.OwnerID, reasoningSource)
|
||||
if err != nil {
|
||||
return generationPrepared{}, err
|
||||
|
||||
@@ -332,103 +332,120 @@ func TestOpenAIResponsesReasoningNotReplayedAfterModelConfigChange(t *testing.T)
|
||||
func TestOpenAIResponsesRetriesWithoutRejectedEncryptedReasoning(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
db, ps := dbtestutil.NewDB(t)
|
||||
ctx := testutil.Context(t, testutil.WaitLong)
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
// freshReasoningAt is the request whose response carries the
|
||||
// first reasoning produced after the rejection.
|
||||
freshReasoningAt int
|
||||
}{
|
||||
{name: "RetryReturnsReasoning", freshReasoningAt: 3},
|
||||
{name: "RetryReturnsNoReasoning", freshReasoningAt: 4},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
const (
|
||||
staleID = "rs_rejected_reasoning"
|
||||
staleBlob = "encrypted-by-another-organization"
|
||||
freshID = "rs_fresh_reasoning"
|
||||
freshBlob = "encrypted-by-current-organization"
|
||||
)
|
||||
var recorder responsesRequestRecorder
|
||||
openAIURL := chattest.NewOpenAI(t, func(req *chattest.OpenAIRequest) chattest.OpenAIResponse {
|
||||
if !req.Stream {
|
||||
return chattest.OpenAINonStreamingResponse("title")
|
||||
}
|
||||
n := recorder.record(req)
|
||||
// Later turns reach an organization that cannot decrypt the
|
||||
// reasoning from the first turn.
|
||||
if n > 1 && slices.ContainsFunc(req.Prompt, func(item interface{}) bool {
|
||||
itemMap, ok := item.(map[string]interface{})
|
||||
return ok && chattest.StringResponseField(itemMap, "id") == staleID
|
||||
}) {
|
||||
resp := chattest.OpenAIErrorResponse(http.StatusBadRequest, "invalid_request_error",
|
||||
"The encrypted content could not be verified.")
|
||||
resp.Error.Code = "invalid_encrypted_content"
|
||||
return resp
|
||||
}
|
||||
switch n {
|
||||
case 1:
|
||||
resp := chattest.OpenAIStreamingResponse(chattest.OpenAITextChunks("answer")...)
|
||||
resp.Reasoning = &chattest.OpenAIReasoningItem{ID: staleID, EncryptedContent: staleBlob}
|
||||
return resp
|
||||
case 3:
|
||||
resp := chattest.OpenAIStreamingResponse(chattest.OpenAIToolCallChunk("list_templates", `{}`))
|
||||
resp.Reasoning = &chattest.OpenAIReasoningItem{ID: freshID, EncryptedContent: freshBlob}
|
||||
return resp
|
||||
default:
|
||||
return chattest.OpenAIStreamingResponse(chattest.OpenAITextChunks("done")...)
|
||||
}
|
||||
})
|
||||
db, ps := dbtestutil.NewDB(t)
|
||||
ctx := testutil.Context(t, testutil.WaitLong)
|
||||
|
||||
user, org, _ := seedChatDependenciesWithProvider(t, db, "openai", openAIURL)
|
||||
model := insertChatModelConfigWithCallConfig(t, db, user.ID, "openai", "gpt-4o",
|
||||
codersdk.ChatModelCallConfig{})
|
||||
factory := chattest.NewMockAIBridgeTransport(t, openAIURL)
|
||||
newServer := func() *chatd.Server {
|
||||
return newOpenAIResponsesTestServer(t, db, ps, func(cfg *chatd.Config) {
|
||||
cfg.AIBridgeTransportFactory = chatAIGatewayTransportFactoryPointer(factory)
|
||||
const (
|
||||
staleID = "rs_rejected_reasoning"
|
||||
staleBlob = "encrypted-by-another-organization"
|
||||
freshID = "rs_fresh_reasoning"
|
||||
freshBlob = "encrypted-by-current-organization"
|
||||
)
|
||||
var recorder responsesRequestRecorder
|
||||
openAIURL := chattest.NewOpenAI(t, func(req *chattest.OpenAIRequest) chattest.OpenAIResponse {
|
||||
if !req.Stream {
|
||||
return chattest.OpenAINonStreamingResponse("title")
|
||||
}
|
||||
n := recorder.record(req)
|
||||
// Later turns reach an organization that cannot decrypt the
|
||||
// reasoning from the first turn.
|
||||
if n > 1 && slices.ContainsFunc(req.Prompt, func(item interface{}) bool {
|
||||
itemMap, ok := item.(map[string]interface{})
|
||||
return ok && chattest.StringResponseField(itemMap, "id") == staleID
|
||||
}) {
|
||||
resp := chattest.OpenAIErrorResponse(http.StatusBadRequest, "invalid_request_error",
|
||||
"The encrypted content could not be verified.")
|
||||
resp.Error.Code = "invalid_encrypted_content"
|
||||
return resp
|
||||
}
|
||||
resp := chattest.OpenAIStreamingResponse(chattest.OpenAITextChunks("done")...)
|
||||
if n == 3 {
|
||||
resp = chattest.OpenAIStreamingResponse(chattest.OpenAIToolCallChunk("list_templates", `{}`))
|
||||
}
|
||||
switch n {
|
||||
case 1:
|
||||
resp.Reasoning = &chattest.OpenAIReasoningItem{ID: staleID, EncryptedContent: staleBlob}
|
||||
case tc.freshReasoningAt:
|
||||
resp.Reasoning = &chattest.OpenAIReasoningItem{ID: freshID, EncryptedContent: freshBlob}
|
||||
}
|
||||
return resp
|
||||
})
|
||||
|
||||
user, org, _ := seedChatDependenciesWithProvider(t, db, "openai", openAIURL)
|
||||
model := insertChatModelConfigWithCallConfig(t, db, user.ID, "openai", "gpt-4o",
|
||||
codersdk.ChatModelCallConfig{})
|
||||
factory := chattest.NewMockAIBridgeTransport(t, openAIURL)
|
||||
newServer := func() *chatd.Server {
|
||||
return newOpenAIResponsesTestServer(t, db, ps, func(cfg *chatd.Config) {
|
||||
cfg.AIBridgeTransportFactory = chatAIGatewayTransportFactoryPointer(factory)
|
||||
})
|
||||
}
|
||||
server := newServer()
|
||||
sendMessage := func(server *chatd.Server, chatID uuid.UUID, text string) {
|
||||
t.Helper()
|
||||
_, err := server.SendMessage(ctx, chatd.SendMessageOptions{
|
||||
ChatID: chatID,
|
||||
CreatedBy: user.ID,
|
||||
ModelConfigID: model.ID,
|
||||
Content: []codersdk.ChatMessagePart{
|
||||
codersdk.ChatMessageText(text),
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
waitForChatProcessed(ctx, t, db, chatID, server)
|
||||
requireResponsesChatWaiting(ctx, t, db, chatID)
|
||||
}
|
||||
|
||||
chat, err := server.CreateChat(ctx, chatd.CreateOptions{
|
||||
OrganizationID: org.ID,
|
||||
OwnerID: user.ID,
|
||||
Title: uniqueResponsesTitle(t, "rejected-reasoning"),
|
||||
ModelConfigID: model.ID,
|
||||
InitialUserContent: []codersdk.ChatMessagePart{
|
||||
codersdk.ChatMessageText("hello"),
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
waitForChatProcessed(ctx, t, db, chat.ID, server)
|
||||
requireResponsesChatWaiting(ctx, t, db, chat.ID)
|
||||
sendMessage(server, chat.ID, "list the templates")
|
||||
|
||||
// The next turn runs on a server that never saw the rejection,
|
||||
// like a restarted or different replica.
|
||||
require.NoError(t, server.Close())
|
||||
sendMessage(newServer(), chat.ID, "thanks")
|
||||
|
||||
// Only the first request after the change is rejected.
|
||||
requests := recorder.all()
|
||||
require.Len(t, requests, 5)
|
||||
requireInlineReasoningItem(t, requests[1].Prompt, staleID, staleBlob, "")
|
||||
retry := requests[2]
|
||||
require.NotEmpty(t, retry.Prompt)
|
||||
require.NotContains(t, promptItemTypes(retry.Prompt), "reasoning")
|
||||
// requests[3] is the step after the tool call; requests[4] is
|
||||
// the next turn on the fresh server.
|
||||
for i, request := range requests[3:] {
|
||||
requireNoResponsesProviderItemReplay(t, request.Prompt, staleID)
|
||||
if i+3 < tc.freshReasoningAt {
|
||||
require.NotContains(t, promptItemTypes(request.Prompt), "reasoning")
|
||||
continue
|
||||
}
|
||||
requireInlineReasoningItem(t, request.Prompt, freshID, freshBlob, "")
|
||||
}
|
||||
})
|
||||
}
|
||||
server := newServer()
|
||||
sendMessage := func(server *chatd.Server, chatID uuid.UUID, text string) {
|
||||
t.Helper()
|
||||
_, err := server.SendMessage(ctx, chatd.SendMessageOptions{
|
||||
ChatID: chatID,
|
||||
CreatedBy: user.ID,
|
||||
ModelConfigID: model.ID,
|
||||
Content: []codersdk.ChatMessagePart{
|
||||
codersdk.ChatMessageText(text),
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
waitForChatProcessed(ctx, t, db, chatID, server)
|
||||
requireResponsesChatWaiting(ctx, t, db, chatID)
|
||||
}
|
||||
|
||||
chat, err := server.CreateChat(ctx, chatd.CreateOptions{
|
||||
OrganizationID: org.ID,
|
||||
OwnerID: user.ID,
|
||||
Title: uniqueResponsesTitle(t, "rejected-reasoning"),
|
||||
ModelConfigID: model.ID,
|
||||
InitialUserContent: []codersdk.ChatMessagePart{
|
||||
codersdk.ChatMessageText("hello"),
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
waitForChatProcessed(ctx, t, db, chat.ID, server)
|
||||
requireResponsesChatWaiting(ctx, t, db, chat.ID)
|
||||
sendMessage(server, chat.ID, "list the templates")
|
||||
|
||||
// The next turn runs on a server that never saw the rejection, like
|
||||
// a restarted or different replica.
|
||||
require.NoError(t, server.Close())
|
||||
sendMessage(newServer(), chat.ID, "thanks")
|
||||
|
||||
// Only the first request after the change is rejected.
|
||||
requests := recorder.all()
|
||||
require.Len(t, requests, 5)
|
||||
requireInlineReasoningItem(t, requests[1].Prompt, staleID, staleBlob, "")
|
||||
retry := requests[2]
|
||||
require.NotEmpty(t, retry.Prompt)
|
||||
require.NotContains(t, promptItemTypes(retry.Prompt), "reasoning")
|
||||
// requests[3] is the step after the tool call; requests[4] is the next
|
||||
// turn on the fresh server.
|
||||
for _, request := range requests[3:] {
|
||||
requireInlineReasoningItem(t, request.Prompt, freshID, freshBlob, "")
|
||||
requireNoResponsesProviderItemReplay(t, request.Prompt, staleID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOpenAIResponsesReasoningNotReplayedAfterCredentialChange(t *testing.T) {
|
||||
|
||||
@@ -36,6 +36,13 @@ type buildCommitStepMessagesInput struct {
|
||||
reasoningProvenance reasoningProvenance
|
||||
}
|
||||
|
||||
func stampReasoningProvenance(part *codersdk.ChatMessagePart, provenance reasoningProvenance) {
|
||||
part.ProviderIdentity = provenance.ProviderIdentity
|
||||
part.ProviderModel = provenance.Model
|
||||
part.ProviderCredential = provenance.Credential
|
||||
part.ReasoningEpoch = provenance.Epoch
|
||||
}
|
||||
|
||||
type stepMessagesForCommit struct {
|
||||
Messages []chatstate.Message
|
||||
// ConsumeCompactionRequest clears the manual compaction marker
|
||||
@@ -51,14 +58,19 @@ func buildCommitStepMessages(input buildCommitStepMessagesInput) (stepMessagesFo
|
||||
|
||||
assistantBlocks, toolResults := splitStepContent(input.step.Content)
|
||||
assistantParts := buildAssistantParts(input.logger, assistantBlocks, toolResults, input.step, input.toolNameToConfigID, input.hookRewrittenToolCalls)
|
||||
stamped := false
|
||||
for i := range assistantParts {
|
||||
if assistantParts[i].Type == codersdk.ChatMessagePartTypeReasoning {
|
||||
assistantParts[i].ProviderIdentity = input.reasoningProvenance.ProviderIdentity
|
||||
assistantParts[i].ProviderModel = input.reasoningProvenance.Model
|
||||
assistantParts[i].ProviderCredential = input.reasoningProvenance.Credential
|
||||
assistantParts[i].ReasoningEpoch = input.reasoningProvenance.Epoch
|
||||
stampReasoningProvenance(&assistantParts[i], input.reasoningProvenance)
|
||||
stamped = true
|
||||
}
|
||||
}
|
||||
// Without a stamp, a step that produced no reasoning would lose the
|
||||
// rejection epoch, and the next step would replay the rejected
|
||||
// reasoning again.
|
||||
if !stamped && input.reasoningProvenance.Epoch > 0 && len(assistantParts) > 0 {
|
||||
stampReasoningProvenance(&assistantParts[0], input.reasoningProvenance)
|
||||
}
|
||||
|
||||
messages := make([]chatstate.Message, 0, 1+len(toolResults))
|
||||
if len(assistantParts) > 0 {
|
||||
|
||||
@@ -46,9 +46,10 @@ const (
|
||||
// reasoningProvenance identifies where OpenAI reasoning state was produced.
|
||||
// Reasoning item IDs only resolve on the issuing provider instance, and
|
||||
// encrypted content can be rejected by a different model or by the
|
||||
// organization behind a different credential. Epoch counts the provider's
|
||||
// rejections of the chat's encrypted reasoning, so reasoning replayed into
|
||||
// a rejected call is never replayed again.
|
||||
// organization behind a different credential. Epoch counts rejections of
|
||||
// the chat's encrypted reasoning from the same provider, model, and
|
||||
// credential, so reasoning replayed into a rejected call is never replayed
|
||||
// again.
|
||||
type reasoningProvenance struct {
|
||||
ProviderIdentity string
|
||||
Model string
|
||||
@@ -56,6 +57,22 @@ type reasoningProvenance struct {
|
||||
Epoch int
|
||||
}
|
||||
|
||||
// sameSource reports whether p and o name the same provider, model, and
|
||||
// credential, regardless of epoch.
|
||||
func (p reasoningProvenance) sameSource(o reasoningProvenance) bool {
|
||||
return p.ProviderIdentity == o.ProviderIdentity && p.Model == o.Model && p.Credential == o.Credential
|
||||
}
|
||||
|
||||
// stampedReasoningProvenance returns the provenance recorded on part.
|
||||
func stampedReasoningProvenance(part codersdk.ChatMessagePart) reasoningProvenance {
|
||||
return reasoningProvenance{
|
||||
ProviderIdentity: part.ProviderIdentity,
|
||||
Model: part.ProviderModel,
|
||||
Credential: part.ProviderCredential,
|
||||
Epoch: part.ReasoningEpoch,
|
||||
}
|
||||
}
|
||||
|
||||
// reasoningCredential names the credential an AI Gateway route sends.
|
||||
func reasoningCredential(auth aiGatewayProviderAuth) string {
|
||||
if len(auth.Headers) > 0 {
|
||||
@@ -75,9 +92,11 @@ func unstampedReasoningProvenance(rowOrigin, target reasoningProvenance) reasoni
|
||||
}
|
||||
}
|
||||
|
||||
// currentReasoningEpoch returns the highest epoch stamped on providerIdentity's
|
||||
// reasoning in rows.
|
||||
func currentReasoningEpoch(rows []database.ChatMessage, providerIdentity string) int {
|
||||
// currentReasoningEpoch returns the highest epoch recorded in rows for the
|
||||
// provider, model, and credential of target. A rejected request only
|
||||
// replayed reasoning from that source, so the rejection says nothing about
|
||||
// reasoning from other models or credentials.
|
||||
func currentReasoningEpoch(rows []database.ChatMessage, target reasoningProvenance) int {
|
||||
epoch := 0
|
||||
for _, row := range rows {
|
||||
if row.Role != database.ChatMessageRoleAssistant || !bytes.Contains(row.Content.RawMessage, []byte(`"reasoning_epoch"`)) {
|
||||
@@ -88,8 +107,8 @@ func currentReasoningEpoch(rows []database.ChatMessage, providerIdentity string)
|
||||
continue
|
||||
}
|
||||
for _, part := range parts {
|
||||
if part.Type == codersdk.ChatMessagePartTypeReasoning && part.ProviderIdentity == providerIdentity {
|
||||
epoch = max(epoch, part.ReasoningEpoch)
|
||||
if source := stampedReasoningProvenance(part); source.sameSource(target) {
|
||||
epoch = max(epoch, source.Epoch)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,12 +196,7 @@ func stripForeignProviderStateRows(
|
||||
func isForeignReasoning(part codersdk.ChatMessagePart, rowOrigin, target reasoningProvenance) bool {
|
||||
source := unstampedReasoningProvenance(rowOrigin, target)
|
||||
if part.ProviderIdentity != "" {
|
||||
source = reasoningProvenance{
|
||||
ProviderIdentity: part.ProviderIdentity,
|
||||
Model: part.ProviderModel,
|
||||
Credential: part.ProviderCredential,
|
||||
Epoch: part.ReasoningEpoch,
|
||||
}
|
||||
source = stampedReasoningProvenance(part)
|
||||
}
|
||||
return source != target && hasOpenAIReasoningState(part)
|
||||
}
|
||||
|
||||
@@ -374,22 +374,30 @@ func TestStripForeignProviderStateRows(t *testing.T) {
|
||||
require.Equal(t, providerSwitchStripStats{RemovedReasoning: 2}, stats)
|
||||
})
|
||||
|
||||
t.Run("current epoch is per provider", func(t *testing.T) {
|
||||
t.Run("current epoch is per provider model and credential", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
epoch := func(source reasoningProvenance, n int) reasoningProvenance {
|
||||
source.Epoch = n
|
||||
at := func(source reasoningProvenance, credential string, epoch int) reasoningProvenance {
|
||||
source.Credential = credential
|
||||
source.Epoch = epoch
|
||||
return source
|
||||
}
|
||||
otherModelAhead := epoch(openAIInstanceOtherModel, 3)
|
||||
deployment := at(openAIInstance, reasoningCredentialDeployment, 0)
|
||||
// A step with no reasoning records its epoch on its first part.
|
||||
marker := text("no reasoning")
|
||||
stampReasoningProvenance(&marker, at(openAIInstance, reasoningCredentialDeployment, 3))
|
||||
rows := []database.ChatMessage{
|
||||
userRow(t, "hi"),
|
||||
assistantRow(t, openAIInstanceCfg, stampedFull(epoch(openAIInstance, 2)), openAIReasoning),
|
||||
assistantRow(t, openAIInstanceOtherModelCfg, stampedFull(otherModelAhead), text("done")),
|
||||
assistantRow(t, openAIInstanceCfg, stampedFull(epoch(otherOpenAIInstance, 5))),
|
||||
assistantRow(t, openAIInstanceCfg, stampedFull(at(openAIInstance, reasoningCredentialDeployment, 2)), openAIReasoning),
|
||||
assistantRow(t, openAIInstanceCfg, marker),
|
||||
assistantRow(t, openAIInstanceOtherModelCfg, stampedFull(at(openAIInstanceOtherModel, reasoningCredentialDeployment, 4))),
|
||||
assistantRow(t, openAIInstanceCfg, stampedFull(at(openAIInstance, reasoningCredentialUser, 5))),
|
||||
assistantRow(t, openAIInstanceCfg, stampedFull(at(otherOpenAIInstance, reasoningCredentialDeployment, 6))),
|
||||
}
|
||||
require.Equal(t, 3, currentReasoningEpoch(rows, openAIInstance.ProviderIdentity))
|
||||
require.Equal(t, 5, currentReasoningEpoch(rows, otherOpenAIInstance.ProviderIdentity))
|
||||
require.Zero(t, currentReasoningEpoch(rows, vllm.ProviderIdentity))
|
||||
require.Equal(t, 3, currentReasoningEpoch(rows, deployment))
|
||||
require.Equal(t, 4, currentReasoningEpoch(rows, at(openAIInstanceOtherModel, reasoningCredentialDeployment, 0)))
|
||||
require.Equal(t, 5, currentReasoningEpoch(rows, at(openAIInstance, reasoningCredentialUser, 0)))
|
||||
require.Equal(t, 6, currentReasoningEpoch(rows, at(otherOpenAIInstance, reasoningCredentialDeployment, 0)))
|
||||
require.Zero(t, currentReasoningEpoch(rows, at(vllm, reasoningCredentialDeployment, 0)))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
+6
-3
@@ -519,9 +519,12 @@ type ChatMessagePart struct {
|
||||
// because encrypted reasoning only decrypts for the organization
|
||||
// behind that credential. Internal only: stripped before API responses.
|
||||
ProviderCredential string `json:"provider_credential,omitempty" typescript:"-"`
|
||||
// ReasoningEpoch records how many times the producing provider had
|
||||
// rejected the chat's encrypted reasoning before this reasoning part
|
||||
// was produced. Internal only: stripped before API responses.
|
||||
// ReasoningEpoch records how many times the provider had rejected the
|
||||
// chat's encrypted reasoning from this provider, model, and credential
|
||||
// before this reasoning part was produced. A step that produced no
|
||||
// reasoning after a rejection records its epoch, provider, model, and
|
||||
// credential on its first part instead. Internal only: stripped before
|
||||
// API responses.
|
||||
ReasoningEpoch int `json:"reasoning_epoch,omitempty" typescript:"-"`
|
||||
// ProviderExecuted indicates the tool call was executed by
|
||||
// the provider (e.g. Anthropic computer use).
|
||||
|
||||
Generated
+1
-1
@@ -4404,7 +4404,7 @@ Status Code **200**
|
||||
| `»»» provider_metadata` | array | false | | Provider metadata holds provider-specific response metadata (e.g. Anthropic cache control hints) as raw JSON. Internal only: stripped by db2sdk before API responses. |
|
||||
| `»»» provider_model` | string | false | | Provider model records the model that produced a reasoning part, because a model config's model can change after the message was written. Internal only: stripped before API responses. |
|
||||
| `»»» reasoning_delta` | string | false | | |
|
||||
| `»»» reasoning_epoch` | integer | false | | Reasoning epoch records how many times the producing provider had rejected the chat's encrypted reasoning before this reasoning part was produced. Internal only: stripped before API responses. |
|
||||
| `»»» reasoning_epoch` | integer | false | | Reasoning epoch records how many times the provider had rejected the chat's encrypted reasoning from this provider, model, and credential before this reasoning part was produced. A step that produced no reasoning after a rejection records its epoch, provider, model, and credential on its first part instead. Internal only: stripped before API responses. |
|
||||
| `»»» result` | array | false | | |
|
||||
| `»»» result_delta` | string | false | | |
|
||||
| `»»» result_reset` | boolean | false | | |
|
||||
|
||||
Generated
+1
-1
@@ -3403,7 +3403,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
| `provider_metadata` | array of integer | false | | Provider metadata holds provider-specific response metadata (e.g. Anthropic cache control hints) as raw JSON. Internal only: stripped by db2sdk before API responses. |
|
||||
| `provider_model` | string | false | | Provider model records the model that produced a reasoning part, because a model config's model can change after the message was written. Internal only: stripped before API responses. |
|
||||
| `reasoning_delta` | string | false | | |
|
||||
| `reasoning_epoch` | integer | false | | Reasoning epoch records how many times the producing provider had rejected the chat's encrypted reasoning before this reasoning part was produced. Internal only: stripped before API responses. |
|
||||
| `reasoning_epoch` | integer | false | | Reasoning epoch records how many times the provider had rejected the chat's encrypted reasoning from this provider, model, and credential before this reasoning part was produced. A step that produced no reasoning after a rejection records its epoch, provider, model, and credential on its first part instead. Internal only: stripped before API responses. |
|
||||
| `result` | array of integer | false | | |
|
||||
| `result_delta` | string | false | | |
|
||||
| `result_reset` | boolean | false | | |
|
||||
|
||||
Reference in new issue
Block a user