fix(discord): checkpoint acknowledged longwork turns#84864
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 25, 2026, 2:23 AM ET / 06:23 UTC. Summary PR surface: Source +211, Tests +498. Total +709 across 12 files. Reproducibility: yes. from source and the PR's focused tests: a Discord/channel run can send an ACK/progress message through message.send, complete later tool work, and then return no final payload. I did not run a live Discord reproduction in this read-only review. Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance: Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the narrow checkpoint after maintainers have redacted live Discord/Gateway evidence that the ACK, later tool work, and single neutral terminal checkpoint are delivered only to the intended reply route. Do we have a high-confidence way to reproduce the issue? Yes from source and the PR's focused tests: a Discord/channel run can send an ACK/progress message through message.send, complete later tool work, and then return no final payload. I did not run a live Discord reproduction in this read-only review. Is this the best way to solve the issue? Mostly yes: carrying explicit post-delivery tool activity into runReplyAgent and gating the checkpoint by Discord route-aware ACK evidence is a narrow maintainable fix. The remaining blocker is real transport proof, not an obvious code-shape defect. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against b96211063755. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +211, Tests +498. Total +709 across 12 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
142c749 to
7cfafb4
Compare
|
Follow-up update after the proof/rebase pass:
One CI check still reports red: |
39fe32a to
1e55092
Compare
1e55092 to
b232f89
Compare
Track messaging-tool delivery with a completed-tool ordinal so post-ACK activity is detected without depending on tool metadata or item lifecycle timing. Surface a neutral Discord checkpoint when a turn sends an earlier ACK/progress update, completes later tool work, and otherwise has no final visible payload. Keep the guard narrow: Discord only, suppressed for heartbeat/room/silent/ approval/cron lanes, and only triggered by ACK/progress-like text rather than target-only or media-only delivery evidence.
9338640 to
009db0b
Compare
|
Closing this PR as superseded/deferred to reduce the open external PR queue. The underlying acknowledged-longwork terminal-checkpoint issue is still valid, but this branch has become stale and conflict-heavy against current Related active delivery work should continue in the more focused Discord/final-delivery PRs rather than keeping this broader stale branch open. |
Summary
Why this is not refactor-only
message.send, complete additional tool work, and then take the empty-payload/no-final-reply path, leaving the Discord requester with only the earlier ACK and no terminal status.message.send, final-looking cleanup, target-only/media-only evidence, failed sends, heartbeat turns, room events, silent turns, approval prompts, and cron follow-up lanes.toolActivityAfterMessagingToolDeliverythrough the embedded runner result, and gates the synthesized checkpoint inrunReplyAgenton that runtime delivery state plus Discord/ACK evidence.Tests
./node_modules/.bin/oxfmt --check --threads=1 <touched files>node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json <touched files>node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.tsnode scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/pi-embedded-subscribe.handlers.tools.test.tsnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.jsonnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.jsonReal behavior proof
message.send, then completed additional tool work and ended without a final visible payload, now get a narrow neutral terminal checkpoint instead of silently ending. The guard intentionally stays Discord/channel-scoped and is suppressed for terminalmessage.send, final-looking messages followed by cleanup tools, target-only/media-only evidence, failed sends, heartbeat turns, room events, silent turns, approval prompts, and cron follow-up creation.main; no production Gateway, production config, or live runtime state was used.fix/ack-longwork-terminal-checkpointfrom142c74983ab5d80886e9a2fd777f1684b1fcb821onto upstreammain9bd97d2c60ebe68ea40c3a65d346ea56b0ed5a6c, resolving conflicts with the concurrent accepted-session-spawn state additions by preserving both state fields.corepack pnpm install --frozen-lockfileinside the disposable checkout.git diff --check../node_modules/.bin/oxfmt --check --threads=1 <touched files>.node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts -t "acknowledged-longwork checkpoint".node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/pi-embedded-subscribe.handlers.tools.test.ts.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json <touched files>.node --import tsx scripts/check-import-cycles.ts,node --import tsx scripts/check-madge-import-cycles.ts,node scripts/check-deprecated-api-usage.mjs, andnode scripts/check-deprecated-jsdoc.mjs.message.send, final-looking cleanup, target-only/media-only evidence, failed sends, heartbeat, room event, silentExpected, approval prompt, or cron-follow-up lanes.