fix(openai): atomic artifact pair 투영을 교정한다

This commit is contained in:
toki 2026-08-15 14:03:49 +09:00
parent 545ecb3727
commit 3ac0f46c7b
2 changed files with 11 additions and 0 deletions

View file

@ -260,6 +260,12 @@ func (s *artifactFrontierStore) expandSelectorPair(
{ID: pairProviderCallID(providerID, "plan"), ProviderCallID: pairProviderCallID(providerID, "plan"), Name: write.toolName, Arguments: map[string]any{"path": paths.PlanPath, "content": planContent}},
{ID: pairProviderCallID(providerID, "review"), ProviderCallID: pairProviderCallID(providerID, "review"), Name: write.toolName, Arguments: map[string]any{"path": paths.ReviewPath, "content": reviewContent}},
}
// Provider deltas still describe the one selector-private atomic pair call.
// The caller projection owns two replacement writes, so collect them from
// ToolCalls instead of replaying the stale one-call delta inventory.
output.Deltas = nil
output.Content = ""
output.Reasoning = ""
return output, nil
}

View file

@ -324,6 +324,8 @@ func newArtifactPairFixture(t *testing.T, endpoint string, createsParents bool)
func TestArtifactSelectorAtomicPairExpandsToCallerWrites(t *testing.T) {
fixture := newArtifactPairFixture(t, "openai", true)
output, err := fixture.server.artifactFrontiers.expandSelectorPair(fixture.requestID, fixture.ownerEdgeID, normalizedStageOutput{
Content: "selector-private text", Reasoning: "selector-private reasoning",
Deltas: []normalizedStageDelta{{Kind: normalizedStageDeltaTool, ToolID: "provider_pair", ToolName: hotPathArtifactPairToolName, Arguments: `{"plan_content":"old"}`}},
ToolCalls: []normalizedToolCall{{
ID: "provider_pair", Name: hotPathArtifactPairToolName,
Arguments: map[string]any{"plan_content": testLightweightPlan(t), "review_content": testPendingReview(t)},
@ -342,6 +344,9 @@ func TestArtifactSelectorAtomicPairExpandsToCallerWrites(t *testing.T) {
if output.ToolCalls[0].ProviderCallID == output.ToolCalls[1].ProviderCallID {
t.Fatalf("expanded provider ids must be distinct: %+v", output.ToolCalls)
}
if len(output.Deltas) != 0 || output.Content != "" || output.Reasoning != "" {
t.Fatalf("expanded caller writes retained selector-private projection: %+v", output)
}
}
func TestArtifactSelectorAtomicPairDropsGeminiThoughtSignatureEnvelope(t *testing.T) {