mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-04 19:28:46 +01:00
An agent presents its live X-Paperclip-Run-Id, which can reference a heartbeat run that does not exist in this server's DB (e.g. a worktree dev environment whose DB never recorded the run). That run-id is FK-constrained on issues.checkout_run_id/execution_run_id, document_revisions.created_by_run_id and activity_log.run_id, so persisting it raised a FK violation that surfaced as a 500. Board users were unaffected because they carry no run-id. Resolve the run-id to null at each FK-bearing write site when the run is unknown: checkout adoption still grants the assigned agent ownership (without a lock), document provenance and activity logging degrade run_id to null. In real deployments the run exists, so the value is persisted unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>