Repository navigation
fix(line): pace block replies with the agent's humanDelay - #133443
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 2:24 PM ET / 18:24 UTC. ClawSweeper reviewWhat this changesThe PR forwards the routed agent’s existing human-delay policy from LINE webhook admission to the shared streamed-reply dispatcher and adds a per-agent override regression test. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the focused LINE owner-boundary handoff is correct, preserves the default-off behavior, and has credible real-channel before/after evidence. No blocking patch defect was found; exact-head CI is still running. Priority: P2 Review scores
Verification
How this fits togetherLINE webhook events become routed agent turns, whose delivery options flow through the channel-turn lifecycle into the shared reply dispatcher. That dispatcher spaces streamed blocks after the first when the agent’s configured human delay is present. flowchart LR
A[LINE webhook] --> B[Inbound turn admission]
B --> C[Route and live config]
C --> D[LINE delivery adapter]
D --> E[Shared reply dispatcher]
E --> F[Paced LINE block replies]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +60. Total +66 across 2 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the LINE-owned handoff after the exact-head checks complete; retain the shared dispatcher as the sole pacing implementation and track any broader sibling-channel consolidation separately. Do we have a high-confidence way to reproduce the issue? Yes. The PR body provides a real LINE three-block baseline on main and two after-fix timing runs with fixed 8-second delays, while current source identifies the missing handoff. Is this the best way to solve the issue? Yes. Reusing the existing agent-policy resolver at the LINE adapter boundary feeds the already-authoritative dispatcher without a new setting or competing pacing path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ad00ba847d89. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer validation is complete for The defect is the LINE turn adapter omitting the existing agent policy from Independent proof ran on secretless AWS Crabbox
The PR's real LINE A/B remains the authenticated evidence: 2.9s before versus 19.6s/18.4s after two configured 8s gaps. Those runs are contributor-provided; this session independently reproduced the regression and ran the tests above. ClawSweeper's current-head growth and pending-CI items are addressed by the ownership explanation and green run. The omission is present in stable |
|
Merged via squash.
|
Fixes #133430
What Problem This Solves
agents.defaults.humanDelay— and its per-agentagents.entries.*.humanDelayoverride — was accepted on LINE and silently did nothing. Block replies arrived
back-to-back no matter what pause was configured, and nothing in
doctor,startup, or the logs said the channel was ignoring it.
Only
createReplyDispatchercan act on the setting: it readsoptions.humanDelayand sleeps before every block after the first.optionscomes from the turn's
dispatcherOptions, and LINE's turn never set one, so thevalue resolved to
undefinedon every turn.Why This Change Was Made
This is the same defect Telegram had in #68945, fixed in #69022 by forwarding the
resolved config into that channel's
dispatcherOptions. This gives LINE the samewiring — one line at the one seam that owns it — rather than adding a second
pacing mechanism.
It resolves from
turnConfig, not the monitor's captured config. Admissionalready re-read the live config for this event and the delivery path runs on that
same one, so a
humanDelayedited while the gateway is running takes effect onthe very next turn instead of the next restart.
User Impact
On LINE, a configured
humanDelaynow paces block replies: each block after thefirst waits the configured interval, so a multi-message answer arrives at a human
rhythm instead of all at once.
off(the default) is unchanged — no delay, nonew behavior for anyone who has not set the option.
Evidence
Live: real LINE channel, same three-block answer, both sides of the fix
An agent turn that produces three assistant blocks, with
blockStreamingDefault: "on"andhumanDelay: { mode: "custom", minMs: 8000, maxMs: 8000 }. Timing runs from webhook delivery until the channel's push-quotacounter reflects all four sends:
The quota moving by 4 shows LINE delivers each block as its own push, so the
dispatcher path that applies the delay is the one in use. The ~16s difference is
the two paced gaps the setting asks for: the first block and the final reply are
not delayed, so three blocks produce two 8s pauses.
Regression coverage
monitor.lifecycle.test.tsasserts the turn LINE hands to core carries theresolved
humanDelay, and uses a per-agent entry that differs from the defaultsso a turn reading the wrong scope fails rather than passing on a lucky match.
Reverting the change fails it with
expected undefined to deeply equal { mode: 'custom', minMs: 3000, … }.The same test file's two existing turn-adapter cases passed an empty delivery
control, a state admission cannot produce — they now pass the live config the
real path always supplies.
Checks
Sibling surfaces
Seven other channels declare
blockStreaming: trueand also never forward thesetting —
clickclack,googlechat,irc,nextcloud-talk,reef,zalo,zalouser. I verified the mechanism end to end on LINE only, so they are namedin #133430 as follow-up rather than changed blind here. Worth noting for whoever
picks those up:
humanDelayis the onedispatcherOptionsfield that is neitherchannel-specific nor a callback — every channel resolves it from the same agent
config the same way, so absorbing it into
resolveAssembledReplyPipelinewouldfix all eight at once and delete eleven copies of this line. That is an
owner-boundary call, not one to make inside a channel fix.