fix(openai): cleanup에서 이전 tool result를 무시한다

This commit is contained in:
toki 2026-08-15 15:34:33 +09:00
parent a10790b8f2
commit 6173dbd6d7

View file

@ -274,10 +274,20 @@ func (s *hotPathLightStore) consumeCleanupLocked(
results []workspaceResult,
coordinator *logicalRequestCoordinator,
) (logicalRequestSnapshot, hotPathLightDisposition, bool, error) {
if record.terminalIntent == nil || len(record.pending) != 1 || len(results) != 1 {
if record.terminalIntent == nil || len(record.pending) != 1 {
return logicalRequestSnapshot{}, hotPathLightDisposition{}, true, fmt.Errorf("cleanup result set mismatch")
}
var result workspaceResult
matchedResults := 0
for _, candidate := range results {
if _, ok := record.pending[candidate.callID]; ok {
result = candidate
matchedResults++
}
}
if matchedResults != 1 {
return logicalRequestSnapshot{}, hotPathLightDisposition{}, true, fmt.Errorf("cleanup result set mismatch")
}
result := results[0]
pending, ok := record.pending[result.callID]
if !ok || pending.payload == nil {
return logicalRequestSnapshot{}, hotPathLightDisposition{}, true, fmt.Errorf("cleanup result id is not pending")