Repository navigation
refactor(dashboard): one session-side deliver() for cron, app and wake text - #22937
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: moving the idle-or-running choice and the row role out of each sender and into Notes
[DESIGN-REVIEWED] 4a886bb Description read[DESCRIPTION-READ] 4c06f32dfbad9bee4d837cd33f6bbfa15558b129aada9431d6fc56cc28f3492b That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This moves existing behaviour without changing it, and it fixes the cause behind #22747. The two siblings it leaves are named and deferred. One branch nothing reaches yet. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: Cron, app and work-ledger-wake text should always show up as the same row no matter whether the session was busy. FIX (cause-level refactor).
Siblings still unmoved, all declared and deferred: [FIRST-PRINCIPLES-REVIEWED] 4a886bb Description read[DESCRIPTION-READ] fe8d0b2f1964bf2b2f5ea61388fb9c4ec79e3334df15223126e1c7bfcf2036fe That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
bolichen97
left a comment
There was a problem hiding this comment.
Looks good to ship. Head reviewed: 0fe873c.
What I checked by hand, against the base each caller had:
- Cron script result: the idle row (role, cls, meta) and the turn kwargs match the old branch.
_synthetic_payloadstays False because_run_chatdefaults it to False. The running path still callsqueue_cron_notification. - App message: the idle row still comes from
app_inject_row. The queued entry keepsappLabelplus the containment stamp in its meta. A full queue still returns 429 and writes nothing. The admission is released on that path because_adm.commit()now runs only after a delivered outcome. The only new work on the idle path is thecontainment_metaread, which the running path already did. - Work-ledger wake: the steer gets the same
nudge_metaanduser_origin=False. If the turn ends during the earlier mode check,delivernow returns not delivered without calling the steer. The caller already treats that as "the wake stays owed". - The facade
_run_chatandspawn_guarded_turnare the same objects as the onesdeliverimports, so the seam list edits are correct. - The First Principles note about
api_send_messageis answered: the description lists it under the remaining work on the linked issue. - main has not changed any touched file since the merge base.
No must-fix or should-fix findings.
Remaining maintainer checks before approval: PR Readiness is still pending, and the backend test shards are still running on this head. Real Adapter Contract Tests is red. Its annotations show the sandbox backend was not available on the runner, and the failing tests are not in this diff. A rerun after the shards finish should clear it.
|
The only red check on head 0fe873c is Real Adapter Contract Tests: the main-wide failure from #22807 (every |
…k-ledger wake text
0fe873c to
4a886bb
Compare
|
Review-ready on head 4a886bb: pr_status.py exits 0 (105 checks, 0 failing, readiness: passed), GPT and Opus clean on this head, Design / First Principles / UX PASS. Part of #22747: cron, app message and work-ledger wake now go through |
bolichen97
left a comment
There was a problem hiding this comment.
Approving head 4a886bb.
Gates checked on this head:
- Readiness label is passed and PR Readiness is green.
- Required checks are green, including Coverage Gate.
- All AI review lanes name this head. None of them blocks.
- No open change request. No security path is touched.
This head is a rebase only. The range diff matches the commit I reviewed before, so my earlier review stands. One deliver() helper now serves cron, app and wake text.
Problem / Motivation
Goal: Cron notifications, app messages and work-ledger wakes reach a session through one entry point that picks the row from who sent the text, not from whether the session was busy.
Each of these senders decided for itself whether the session was idle or running, and wrote its own row on each branch. That is how the same work-ledger wake text got two different roles (#22747): the role came from which branch the sender happened to pick. #22812 fixed the visible symptom on the steer path; the senders still own the branch choice.
Why it matters
Every new sender, or every edit to an existing one, has to get both branches and both rows right by hand. A miss shows automation text as something the person typed, in a thread they read as their own record.
Not a goal
session_sendpath (slice B), the idle autonudge fire (slice C) or a cron'ssend_message(api_send_message) ontodeliver. This PR moves the script-cron result path only. Both are named under Related Issues.What changed (motivation → approach → change)
Cause → approach: the branch choice and the row lived in each sender. The sender now names its origin; the session owns the branch and the row.
dashboard/session_deliver.py:Origin(automation,cron,app),origin_row()(the one origin → row mapping) anddeliver(). Idle: append the origin's row and start the turn. Running: steer an automation wake (the nudge row from fix(dashboard): a work-ledger wake steered into a running turn stays a nudge row #22812), queue a cron notification or an app message with itsqueuedcard. An idle automation wake returnsNOT_DELIVERED, because that turn is still the autonudge fire's own path.slack/gateway_runtime/cron_exec.py(_deliver_script_result),dashboard/handlers/mcp_apps.py(api_mcp_apps_message) andslack/gateway_runtime/nudge_dashboard_fire.py(_steer_work_ledger_wake) calldeliverinstead of branching.queue_full429 is nowdeliver'sQUEUE_FULLoutcome, and nothing is written in that case.monitor-architecture.md.Size: about 190 production lines in 4 files (the new module is ~120 lines of code, ~70 of docstring; the three callers net about -110).
Backwards compatibility
Compatible: every sender writes the same row, queue entry and turn it wrote before (same role, cls, meta, kind, actor, origin flags). The tests below pin each.
Removes nothing: no key, row, route or validator goes away. The three callers lose their inline branches; the behavior moved, it did not change.
Tests
test/test_session_deliver.py(new): idle cron and app each write theirinjectrow and start a turn with the right actor and flags; an idle wake is left to the fire; a running slot queues a cron notification, queues an app message with its admission stamp, refuses a full queue without writing, and steers a wake as anudgerow; steer outcomes map to delivery outcomes; the cron and wake callers route throughdeliverwith their origin.test/test_mcp_apps_message_endpoint.py: the app handler routes throughdeliverwith theapporigin and its admission; the idle-turn test now patches the turn launch wheredeliverreads it.test_chat_turn_timeout_consistency.py,test_slot_running_readers.py,test_slack_gateway_composition_contract.py,test_slack_gateway_cron_exec_coverage.py.Proof: on
origin/mainwith onlysession_deliver.pyand the new tests added, the three caller-routing tests fail. Related set: 61 test files plus the facade and flake ratchets, 3144 passed (-n 4). The new tests use no clock, sleep or network.Manual verification
N/A — unit coverage sufficient: the rows and turns are unchanged and pinned by tests.
Related Issues
Part of #22747
Remaining on #22747:
session_send(session_messaging.py) ontodeliverwith apeerorigin. It has its own audience fence, cancellation shield and per-target budget.send_messageto its origin session (api_send_messageinhandlers/messaging.py) still branches onslot.runningitself; it moves ontodeliverwith thecronorigin in a follow-up slice._fire_dashboard_nudge) ontodeliver, so theautomationidle path stops returningNOT_DELIVERED. It needs a seam for the fire's completion hook and admission gate.Pattern harvest
Rule candidate: review-prompt
Pattern: a sender that branches on
slot.runningand writes its own row instead of calling the session's delivery entry point.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)