fix(flows): add observability logging and integration test for PR review dispatch #637
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!637
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/610"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the silent-drop bugs and missing regression tests for the
address-reviewdispatch path exposed by issue #610 (PR #604 / issue #567 never got an address-review after the reviewer posted changes_requested).Root cause (investigation findings):
resolve_authorfound no agent for a login, the entire downstream pipeline dropped silently with no log. Same forguardAuthorDispatchcap-hit. The operator saw "no dispatch" but could not tell if the flow ran and dropped, or never ran at all.dispatch_addressusessrc.out.pr.number(PR #604) asissue_numberintask_history, not the linked issue number (#567). A query forissue_number=567would miss the row even if dispatch succeeded.flow-dispatch.test.tshad zero tests that fireddispatchToFlowswith apull_request_review.submittedevent and verified address-review was dispatched.Fixes:
guardAuthorDispatchinreview-loop.ts: emits[review-loop] cap hit/[review-loop] author guard passedlogs withrounds/maxcontext on both paths.resolveAgentByLoginHandlerinagent-nodes.ts: logs[agent-nodes] resolve_by_login: no agent found for login "X" — dropping downstream pipelinebefore emitting FILTER_DROP.DispatchOptionsinflow-dispatch.ts: gains anargDefaultsoverride key so tests can inject lightweight stubs without touching production wiring.flow-dispatch.test.ts: two new regression tests — (1) routing test provingpull_request_review_rejectedForgejo events route correctly, (2) dispatch test running the realpr-changes-requestedgraph with mocked injections and asserting exactly one address-review is dispatched.Test plan
pull_request_review_rejectedForgejo event routes topull_request_review.submittedflowpr-changes-requestedgraph dispatches address-review to dev agentCloses #610
🤖 Generated with Claude Code
"builtin" is not a member of FlowSource ("default" | "operator"); replace with "default" for the baked-in system flow seed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>db9f34628664baea55b7Observability logs correct —
[review-loop]cap-hit/pass and[agent-nodes]no-agent-found all match the format specified in #610.Two regression tests cover routing (
pull_request_review_rejected→pull_request_review.submitted) and full dispatch (real graph, stubbed injections, asserts exactly one address-review).argDefaultsmerge pattern is clean. Clock mock inflows.test.tsxcorrectly pins health computation.CI green. All AC met.
Observability logs correct — [review-loop] cap-hit/pass and [agent-nodes] no-agent-found match the format specified in #610.
Two regression tests cover routing (pull_request_review_rejected -> pull_request_review.submitted) and full dispatch (real graph, stubbed injections, asserts exactly one address-review). argDefaults merge pattern is clean. Clock mock in flows.test.tsx correctly pins health computation.
CI green. All AC met.