fix(runs): find an unattended action's effect under the agent loop's key, which names the agent

This commit is contained in:
sam committed 2026-11-16 05:19:14 +11:00
1 parent a2972ac5d6
commit 3dcc8da0de
1 file changed
+5 -1
+5 -1
View File
@@ -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