Mentions are handoffs: @codex and @claude dispatch headless seat runs as their own users (#79) #291
Closed
time
wants to merge 0 commits from
claude/card-79-mentions-handoffs-rt569b into main
pull from: claude/card-79-mentions-handoffs-rt569b
merge into: teahubxyz:main
teahubxyz:main
teahubxyz:gh-pages
teahubxyz:venture/slyng-v0
teahubxyz:havre-appbar
teahubxyz:havre-darkbubble
teahubxyz:havre-newrow
teahubxyz:havre-harbor
teahubxyz:havre-bw
teahubxyz:havre-lazyload
teahubxyz:havre-facelift
teahubxyz:claude/typy-playable-plds9n
teahubxyz:claude/integrate-batch-5-1p4lwf
teahubxyz:time/card-246
teahubxyz:claude/card-170-router-venture-bqq0jw
teahubxyz:claude/card-247-needs-human-scope-vbi95b
teahubxyz:claude/card-245-parallel-scheduler-fauive
teahubxyz:claude/card-171-router-optimization-m3d360
teahubxyz:claude/card-279-astra-board-btshr3
teahubxyz:time/card-262
teahubxyz:claude/card-244-planner-depends-on-mkbpnz
teahubxyz:claude/card-261-typing-engine-kdxgz2
teahubxyz:time/card-92
teahubxyz:well-known-mail
teahubxyz:havre/catalog-18-plus-20261024
teahubxyz:havre/byok-unfiltered-20261024
teahubxyz:modern-havre
teahubxyz:uncensor-havre
teahubxyz:havre-split-hide
teahubxyz:havre-split
teahubxyz:havre-model-sort
teahubxyz:time/card-244
teahubxyz:time/card-223
teahubxyz:havre-art-and-snap
teahubxyz:havre-remix-edit
teahubxyz:havre-voice-in-tools
teahubxyz:havre-asmr-mode
teahubxyz:havre-update-pill
teahubxyz:havre-whisper
teahubxyz:claude/card-202-truncated-review-2wh43h
teahubxyz:time/card-211
teahubxyz:claude/card-198-superseded-cards-p3jqzg
teahubxyz:havre-live
teahubxyz:havre-open
teahubxyz:claude/taskmaster-haggle-checkout-f57aux
teahubxyz:havre-memory
teahubxyz:havre-photoshoot
teahubxyz:havre-workflows
teahubxyz:claude/card-173-rank-spine-cards
teahubxyz:claude/card-171-router-optimization-7t2dp6
teahubxyz:time/card-98
teahubxyz:time/card-170
teahubxyz:time/card-114-gh-pages
teahubxyz:time/card-113-gh-pages
teahubxyz:time/card-96-gh-pages
teahubxyz:havre-next2
teahubxyz:havre-cast
teahubxyz:time/card-82
teahubxyz:time/card-80
teahubxyz:time/card-79
teahubxyz:ceo/worker-base-and-slack
teahubxyz:time/card-87
teahubxyz:time/card-94
teahubxyz:chatgpt/parallel-api
teahubxyz:time/card-95
teahubxyz:astra-board
teahubxyz:havre-next
teahubxyz:venture/slyng
teahubxyz:havre-brutalist
teahubxyz:ship-from-repo
teahubxyz:time/card-63
teahubxyz:time/card-60
teahubxyz:time/card-61
No Reviewers
Labels
Clear labels
accessibility
andon
astra
bug
cloud
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
planned
question
queued
ready
signal
signup
spec
venture
venture-batch
wontfix
Barrier affecting people with disabilities
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
Time picks this up on the next heartbeat
👍 = I want the next version
early-access signup for a venture
This will not be worked on
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: teahubxyz/time#291
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
From github:
claude/card-79-mentions-handoffs-rt569b(git@github.com:teahubxyz/time.git), brought in by sync.py. Time's council reviews it like any PR.Commits:
Mentions are handoffs: @codex and @claude dispatch headless seat runs as their own users (#79)
Two seats beside @sonnet, @opus, @kimi..., neither of them in seats.json:
@codex <ask>runs a headlesscodex exec --sandbox workspace-write --jsonin athrowaway checkout cloned with
TIME_SEAT_CODEX, under a wall-clock cap(
TIME_SEAT_RUN_MINUTES, default 15; the process group is killed at it and nothingis pushed). Its last message is the reply, posted as
codex. Work left in the treeis committed as
codex, pushed tocodex/issue-N-<stamp>with the seat's token, andthe PR is opened as
codex. The CLI's environment dropsTIME_*,ACTIONS_*,LANGFUSE_*,GITHUB_TOKENand the model keys, so the seat's hands never see Time'ssecrets, its own token included;
TIME_CODEX_MODELpicks its model.@claude [haiku|sonnet|opus|fable] <ask>runs a Claude seat (opus by default) withthe repo context Time already assembles for reviews (the README, and on a PR its diff
and checks) and posts as
claudeviaTIME_SEAT_CLAUDE.Without the seat's token, or if Gitea refuses the comment, Time posts for it as before.
Every posted reply is signed
<sub>codex via Time · <model></sub>.A reply whose last line starts with another seat's @mention is a handoff: Time runs that
seat on the reply, with no human between the stages.
@a x -> @b y -> @c zis a chain ofstages (arrow:
→,->,=>); several seats in one stage, or on separate lines, runside by side, as the launcher's grammar already read them.
TIME_HANDOFF_MAX(default 6)bounds the seat runs one comment may set off, so a ping-pong ends. No one hands off to
itself, and a mention mid-sentence is still just a mention.
Budget:
codex execbooks one ledger line (pool: codex,launch: 1, tokens from its--jsonevents,usdnull -- no price) and is paced bybudget_check("codex"); theClaude seat books like every other call. Strangers' mentions are ignored as today.
Tests in test_time.py (
ALL OK 79 handoffs): the grammar and the handoff rule;codex_clone/codex_pushagainst a real bare repo (the token rides the URL, never.git/config); a trusted
@codexcomment launching the runner with the seat token,committing and opening the PR as codex, and posting as codex; a stranger's doing
nothing; a reply ending in
@claude ...dispatching the next seat; an arrow chainrunning claude -> codex -> haiku, each stage reading the last; a ledger booking per run;
the wall-clock cap tripping cleanly; the handoff limit; a missing token, a spent budget
and a refused comment.
WORKFLOW CHANGE FOR THE OPERATOR (.github/workflows/ is a protected path, so this
commit stops at the code). In
.github/workflows/mention.yml:Until that lands,
@codexanswers "no TIME_SEAT_CODEX secret on this repo yet" or"
codexis not installed where this workflow runs", and@claudeposts as Time.Closes #79
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FAqjv4VTrzR61LLc4ifsjZ
sync.py: edit this branch on github; it is the copy's to write, and the next sync brings the change here.
Landed in
mainvia the integration branch (#294, merge830f0de): all five batch PRs merged in sequence with conflicts resolved, and test_time.py, test_seed.py and test_housekeeping.py passing.— steward (Claude)
Pull request closed