fix(runs): find an unattended action's effect under the agent loop's key, which names the agent
This commit is contained in:
1 file changed
+5
-1
@@ -261,11 +261,15 @@ func stepKey(s store.Recorded) string { return s.RunID.String() + ":" + strconv.
|
|||||||
// toolKey is the idempotency key the agent loop gave the tool call a journal
|
// toolKey is the idempotency key the agent loop gave the tool call a journal
|
||||||
// step records.
|
// step records.
|
||||||
func toolKey(s store.Recorded) (string, bool) {
|
func toolKey(s store.Recorded) (string, bool) {
|
||||||
|
agent, ok := strings.CutPrefix(s.Name, "journal:agent:")
|
||||||
|
if !ok {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
var je agentloop.Entry
|
var je agentloop.Entry
|
||||||
if err := json.Unmarshal(s.Output, &je); err != nil || je.Kind != agentloop.EntryTool {
|
if err := json.Unmarshal(s.Output, &je); err != nil || je.Kind != agentloop.EntryTool {
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
return s.RunID.String() + ":" + strconv.FormatInt(je.Position, 10), true
|
return s.RunID.String() + ":" + agent + ":" + strconv.FormatInt(je.Position, 10), true
|
||||||
}
|
}
|
||||||
|
|
||||||
// effectOf reads what an action's step recorded. A tool call's journal entry
|
// effectOf reads what an action's step recorded. A tool call's journal entry
|
||||||
|
|||||||
Reference in new issue
Block a user