Repository navigation
fix(release): forward-port #29412 cron gate agent identity to 0.12 - #29565
Conversation
…29412) A cron turn handed the PreToolUse gate its cron:<job> session key but no agent, so resolve_active_scope skipped the task bind on the agent name. A profile an administrator binds to an agent governed its chat turns but not its cron turns. Hand the gate the alias or crew record name a chat turn on that agent hands it: each step's alias on an agent_sequence. On a single-agent job whose capture selected a member, the member's live alias (the record dispatch resolves through member_config_for_id), else its captured selection_name, whatever the job's agent names; otherwise the job's agent_id, else the agent that runs. Read before a crewmate's worker swap. The dispatched template stays on session acquisition and message build. (cherry picked from commit 46af64f) Forward-port conflict: test/test_cron_sequence_member_alias.py. On main the new test follows tests from #28410, which this branch does not carry. Kept the release file and appended only the new test.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a clean release pick of a fix already merged on main, it removes nothing, and the gate's Notes
[DESIGN-REVIEWED] ff2dca2 Description read[DESCRIPTION-READ] 9301e670fc2e16dac1719a0f7048f3c020276a52afca1785f4157d9e781b242c 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 backports merged fix #29412 to 0.12, and nothing in it blocks. One sibling-site set is still unfixed, and the PR says so: heartbeat and Slack-nudge, tracked in #29411. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: on 0.12, a profile an administrator binds to an agent also governs that agent's scheduled cron turns, not only its chat turns. FIX.
[FIRST-PRINCIPLES-REVIEWED] ff2dca2 Description read[DESCRIPTION-READ] 9817e3f496b312f0acf92503d3daf5c7aa346e0368e321a1181b09b098c645ff 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: |
Problem / Motivation
Goal: Cron turns on 0.12 are governed by the profile an administrator binds to their agent, the same as chat turns on that agent.
On release/0.12.0 a cron turn hands the PreToolUse gate its
cron:<job>session key but no agent, soresolve_active_scopeskips the task bind on the agent name. A profile bound to an agent governs its chat turns but not its cron turns. #29412 fixed this on main; #29386 brought the other 0.12 picks without this cron mirror.Why it matters
An operator who restricts an agent with a bound profile expects every turn that agent runs to obey it. On 0.12 a scheduled job on that agent runs outside the restriction, unattended.
Not a goal
What changed (motivation → approach → change)
Cherry-pick (
-x) of #29412's merged commit46af64f9onto release/0.12.0. The gate now gets the alias or crew record name a chat turn on that agent would hand it: each step's alias on anagent_sequence; on a single-agent job whose capture selected a member, the member's live alias (viamember_config_for_id), else its capturedselection_name; otherwise the job'sagent_id, else the agent that runs. It is read before a crewmate's worker swap. The dispatched template stays on session acquisition and message build.Forward-port conflict:
test/test_cron_sequence_member_alias.py. On main the new test follows tests from #28410, which this branch does not carry. Kept the release file and appended only the new test. The other four files applied cleanly, and all five files match #29412's added and removed lines.Backwards compatibility
Compatible: cron turns gain an agent at the gate; a job whose agent has no bound profile resolves the same scope as before.
Removes nothing: the change only adds an agent argument to the cron gate call.
Tests
Proof: not provable -- other: release-branch pick of a merged fix; the proof ran on #29412
Run on this branch, one file at a time with
-n 0:test/test_governance_unattended_turns.py: 22 passedtest/test_cron_sequence_member_alias.py: 12 passedtest/test_cron_ephemeral_session.py: 17 passedtest/test_cron_crewmate_worker.py: 12 passedflake8, isort, black and mypy are clean on the touched files.
Manual verification
N/A — unit coverage sufficient; the same change passed review and CI on #29412.
Related Issues
Refs #29412
Part of #29411
Sibling sweep
Siblings: none -- the heartbeat and Slack-nudge sites are tracked in #29411 and are not part of this pick
Pattern harvest
Not generalizable: a release pick of one merged fix; the class is tracked on #29411.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.