fix(server): use run.id for activity_log in heartbeat invoke/resume (#3424)
## Summary - The heartbeat invoke and resume endpoints log activity with `actor.runId` (the caller's auto-generated run ID from JWT), which hasn't been registered in `heartbeat_runs` yet - This causes a FK constraint violation: `activity_log.run_id → heartbeat_runs.id` - Fix: use `run.id` (the newly created heartbeat_run) instead, which is guaranteed to exist in the table ## Test plan - [ ] Trigger a heartbeat invoke via the API — verify no FK constraint error in logs - [ ] Trigger a heartbeat resume — verify activity_log row is created successfully - [ ] Verify existing activity_log queries still return correct results 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4f5abf6007
commit
3b16ac3804
|
|
@ -3329,7 +3329,7 @@ export function agentRoutes(
|
|||
actorType: actor.actorType,
|
||||
actorId: actor.actorId,
|
||||
agentId: actor.agentId,
|
||||
runId: actor.runId,
|
||||
runId: run.id,
|
||||
action: "heartbeat.invoked",
|
||||
entityType: "heartbeat_run",
|
||||
entityId: run.id,
|
||||
|
|
@ -3420,7 +3420,7 @@ export function agentRoutes(
|
|||
actorType: actor.actorType,
|
||||
actorId: actor.actorId,
|
||||
agentId: actor.agentId,
|
||||
runId: actor.runId,
|
||||
runId: run.id,
|
||||
action: "heartbeat.invoked",
|
||||
entityType: "heartbeat_run",
|
||||
entityId: run.id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue