fix(openai): cleanup에서 이전 tool result를 무시한다
This commit is contained in:
parent
a10790b8f2
commit
6173dbd6d7
1 changed files with 12 additions and 2 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue