Skip to content

exec: v1.4 notify: callbacks route like any request, one notification per job - #401

Merged
jaredLunde merged 1 commit into
mainfrom
jared/exec-v14-notify-rev3
Oct 18, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
jared/exec-v14-notify-rev3

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

Revises the v1.4 "Sandbox job notify" spec. As before, the spec, FLEET.md, ARCHITECTURE.md, the fixtures and the coverage test change together. Nothing is implemented yet.

Callbacks route like any request. A replica that doesn't have the session open now answers a callback 503, the same as for any request for a session it doesn't hold, instead of 200 {"listener": false}.

  • The edge's usual retry and ring walk (Requirement 2) then reach the owner after a restart or a ring change. Before, the old hash target ended the notification.
  • E3 now routes callbacks exactly like any request for the session.
  • A callback still never opens a session, and the token is still verified before the session lookup.
  • When no replica has the session open, the sandbox's retries run out within 723 s and nothing has happened.

Other changes

  • A bash_job call has the job: a callback is answered 503, so the sandbox asks again once the call has recorded the end or put the job back.
  • One notification per job:
    • A change that happens during an in-flight attempt gets its own attempt when that one ends.
    • An answer settles only what was owed when its attempt began.
  • Release: the live reconcile a release starts begins after the stream is closed, and never shares a reconcile that began earlier.
  • A late-found end:
    • It is recorded at the listed ended time (finish_at), as reattach records it today.
    • If the follow then fails to read the rest, the end keeps the listed status.
  • bash_job on an unheld job: the call reads in what the sandbox holds first (read_in), then follows.
  • New state name: v1.4's state is now called unheld, and the spec says explicitly that it is not JobShared::released.
  • Smaller clarifications:
    • The baseline's only path to notify is the endpoint's advertisement.
    • Transcript identity is defined (Persistence::transcript).
    • The open reconcile counts only once it has succeeded.
    • Notify is unavailable after a switch_session to another transcript.
    • The curl config's quoting is specified, and curl uses the sandbox's proxy variables.
    • Callbacks are classified before head parsing.
    • The exec client keeps no idle connection past 30 s and sends no TCP keepalive.
    • The accepted difference covers a superseded owner that hasn't noticed yet.
    • The motivation now names attached and kept-alive sessions.
  • Edge: E7 forbids logging a callback's token. E1 decodes query keys the way the replica does.

exec_notify_vectors passes 10/10. New receiver cases cover a job a call has, a proof during a call, and the 503 from a replica without the session.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk

… per job, unheld state

A replica without the session now answers a callback 503, as it answers
any request for a session it does not hold, so the edge's retry and ring
walk find the owner after a restart or a ring change; the edge no longer
pins callbacks to the hashed target. A callback still never opens a
session, and the token is still verified first.

- A callback while a bash_job call has the job is answered 503, so the
  sandbox asks again once the call has recorded the end or put it back.
- A job has one notification at a time; a change during an attempt gets
  its own attempt when that one ends, and an answer settles only what
  was owed when its attempt began.
- The live reconcile a release starts begins after the stream is closed
  and never shares an earlier one.
- A late-found end is recorded at the listed ended time, and with the
  listed status if the follow then fails; a bash_job peek reads in first.
- v1.4's state is named "unheld", not to be confused with
  JobShared::released.
- The edge must not log a callback's token (E7), decodes query keys as
  the replica does, and the exec runner's client keeps no idle
  connection past 30 s and no TCP keepalive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk
@jaredLunde
jaredLunde enabled auto-merge October 18, 2026 23:32
@jaredLunde
jaredLunde added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit a0a76ee Oct 18, 2026
13 checks passed
@jaredLunde
jaredLunde deleted the jared/exec-v14-notify-rev3 branch October 18, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant