Repository navigation
fix: enforce agent wake boundaries - #26
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff6c4fee1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ? (triggerEvent.payload as Record<string, unknown>) | ||
| : {}; | ||
| let replyBlock: string | null = null; | ||
| if (triggerEvent.kind === EventKind.COMMENT_CREATED) { |
There was a problem hiding this comment.
Handle COMMENT_UPDATED wake triggers
When an operator edits an existing comment to add @agent, recordChange still treats that COMMENT_UPDATED event as an actionable mention and stamps it onto the WAITING RUNS agent run, but this resume path only builds a reply for COMMENT_CREATED or priority events. In that edited-in mention scenario the run remains WAITING and no fresh provider turn is started, even though webhook/completions agents would be woken by the same event.
Useful? React with 👍 / 👎.
| id: commentId, | ||
| workspaceId: run.workspaceId, | ||
| issueId: run.issueId, | ||
| kind: "BODY", |
There was a problem hiding this comment.
Allow step-comment replies through this lookup
For a COMMENT_CREATED wake routed from an execution-step thread, the Comment row is stored with executionStepId and issueId = null while ensureCanonicalFromEvent maps it onto the parent issue run. Requiring issueId: run.issueId here makes reply null for those valid plan-step replies/mentions, so a paused RUNS agent on a step never resumes from the operator's comment.
Useful? React with 👍 / 👎.
What changed
Root cause and impact
Wake routing mixed the durable activity timeline with executable agent work. Some branches trusted payload
agentIdinstead of authoritative actor identity, status changes touched runs directly, all priority changes reached watchers, and terminal failure comments were emitted outside the run-closing claim. AXI-104 therefore demonstrated a stalled agent reply opening another run, and similar low-signal changes could invoke an LLM unnecessarily.This patch makes notifications and activity broad while keeping the executable wake boundary intentionally narrow and engine-aware.
Validation
pnpm lint(existing repository warnings only)pnpm typecheckpnpm test— 1,236 passed, 1 intentional live-connector skipRelease: v0.13.1 — Reliable agent wake boundaries