Skip to content

Rename agent run → agent session (new /v1 sessions surface)#21

Merged
hbrooks merged 1 commit into
mainfrom
session-rename
Jul 4, 2026
Merged

Rename agent run → agent session (new /v1 sessions surface)#21
hbrooks merged 1 commit into
mainfrom
session-rename

Conversation

@hbrooks

@hbrooks hbrooks commented Jul 4, 2026

Copy link
Copy Markdown
Member

Summary

The backend renamed "agent runs" to "agent sessions": /v1/agents/runs is gone, replaced by /v1/sessions (configs/templates moved to /v1/configs and /v1/templates). This CLI is renamed end to end to speak that surface.

  • Command rename: agent run start/list/get/replay/stop -> agent session start/list/get/replay/stop. All help text, hints, and human-readable output updated. Flag names are unchanged (--config, --config-override, --prompt, --watch, --json); the --config-override YAML example keeps the literal limits:\n run: 5 key since that config field's name didn't change.
  • agent session stop <id> is now real, calling POST /v1/sessions/{id}/stop and printing the returned status (supports --json). It replaced a fail-loudly stub, since no /v1 stop endpoint existed before.
  • Endpoint paths updated: /v1/agents/runs -> /v1/sessions, /v1/agents/configs -> /v1/configs, /v1/agents/templates -> /v1/templates. The sessions list response envelope key changed from runs to sessions.
  • Types: AgentRun* -> AgentSession*, added the new non-terminal retrying status (excluded from TERMINAL_STATUSES), and SavedAgentConfig.last_job_run_id -> last_agent_session_id (plus a new last_agent_session_created_at).
  • WebSocket: stream URL -> /v1/sessions/{id}/stream, streamRun -> streamSession; reconnect/backoff/resume logic is unchanged.
  • Dashboard URLs: session detail is now {appBase}/{login}/sessions/{id} (was /{login}/agents/runs/{id}); config detail is {appBase}/{login}/agents/configs/{id} (was /{login}/agents/{id}).
  • Renamed dead code src/ui/RunView.tsx -> SessionView.tsx for consistency.
  • Updated all tests and README examples to match.

This is a breaking CLI change: the previously-published agent run command already couldn't work against the current backend (the /v1/agents/runs endpoints it called no longer exist), so there's no meaningful backward-compat path to preserve. The release tag/version bump is handled separately; this PR does not touch package.json's version.

Test plan

  • bun install
  • bun run typecheck (clean)
  • bun run test (vitest, 108/108 passed across 10 files)
  • bun run build (tsup, succeeds)
  • Manually ran the built CLI (node dist/cli.js session --help, session stop --help) to confirm the new command tree and descriptions render correctly

The backend renamed "agent runs" to "agent sessions": /v1/agents/runs is
gone, replaced by /v1/sessions (and /v1/configs, /v1/templates for what
used to live under /v1/agents/*). This CLI now speaks that surface end to
end.

- Command rename: `agent run start/list/get/replay/stop` -> `agent session
  start/list/get/replay/stop`. src/commands/run.tsx -> session.tsx,
  registerRun -> registerSession. All help text, hints, and human output
  updated ("Start and inspect agent sessions", "started session ...",
  "No sessions found.", etc). Flag names unchanged (--config,
  --config-override, --prompt, --watch, --json); the config-override YAML
  example keeps the literal `limits:\n  run: 5` key since that field name
  didn't change.
- `agent session stop <id>` is now real: POST /v1/sessions/{id}/stop,
  replacing the old fail-loudly stub (no /v1 endpoint existed before).
- src/lib/api.ts: /v1/agents/runs -> /v1/sessions, /v1/agents/configs ->
  /v1/configs, /v1/agents/templates -> /v1/templates. List response key
  runs -> sessions. Renamed startAgentRun/listAgentRuns/getAgentRun/
  replayAgentRun to their AgentSession equivalents, added stopAgentSession.
- src/lib/types.ts: AgentRun* -> AgentSession* types, added the
  non-terminal `retrying` status (kept out of TERMINAL_STATUSES),
  SavedAgentConfig.last_job_run_id -> last_agent_session_id (+ new
  last_agent_session_created_at).
- src/lib/ws.ts: stream URL -> /v1/sessions/{id}/stream, streamRun ->
  streamSession, runId option -> sessionId. Reconnect/backoff logic
  unchanged.
- src/lib/urls.ts: runUrl -> sessionUrl (dashboard session detail is now
  /{login}/sessions/{id}); configUrl now points at
  /{login}/agents/configs/{id}.
- src/ui/RunView.tsx (dead code, imported nowhere) -> SessionView.tsx for
  consistency.
- Updated all tests (session.test.ts, urls.test.ts, ws.test.ts,
  api.test.ts) to the new names/paths/response keys, and README.md's
  examples. This is a breaking CLI change; the old `agent run` command and
  /v1/agents/runs endpoints are gone, so there is no backward-compat path.
@hbrooks hbrooks merged commit e67a3f5 into main Jul 4, 2026
1 check passed
hbrooks pushed a commit that referenced this pull request Jul 5, 2026
…ssion handoff` (stacked on #21) (#22)

* Laptop transcript sync: agent hooks install/enroll + agent session sync

- agent hooks install|uninstall|status: idempotently manage the Stop +
  SessionEnd command hooks (async, never block a turn) in
  ~/.claude/settings.json, preserving user-authored hooks
- agent hooks enroll|unenroll: per-repo opt-in consent gate, stored in the
  CLI config (cwd -> origin remote -> owner/name)
- agent session sync: hook-driven (stdin JSON) or manual (flags); checks
  enrollment (silent no-op otherwise), redacts client-side, gzips + base64,
  POSTs /v1/sessions/sync; network failures spool to ~/.config/ellipsis/spool
  (latest snapshot per CC session wins) and flush on the next healthy sync;
  every hook-mode failure path is a quiet exit 0 so a sync problem can never
  disturb a Claude Code session

* agent session handoff: push WIP snapshot + start a cloud handoff session

git stash create snapshots the dirty tree without disturbing it (clean tree
hands off HEAD), pushed to refs/ellipsis/handoff/<sha12>; then POST
/v1/sessions with handoff params + the instructions as the prompt. Requires
--parent (the synced laptop session to chain from).

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
hbrooks pushed a commit that referenced this pull request Jul 5, 2026
…ssion handoff` (stacked on #21) (#22)

* Laptop transcript sync: agent hooks install/enroll + agent session sync

- agent hooks install|uninstall|status: idempotently manage the Stop +
  SessionEnd command hooks (async, never block a turn) in
  ~/.claude/settings.json, preserving user-authored hooks
- agent hooks enroll|unenroll: per-repo opt-in consent gate, stored in the
  CLI config (cwd -> origin remote -> owner/name)
- agent session sync: hook-driven (stdin JSON) or manual (flags); checks
  enrollment (silent no-op otherwise), redacts client-side, gzips + base64,
  POSTs /v1/sessions/sync; network failures spool to ~/.config/ellipsis/spool
  (latest snapshot per CC session wins) and flush on the next healthy sync;
  every hook-mode failure path is a quiet exit 0 so a sync problem can never
  disturb a Claude Code session

* agent session handoff: push WIP snapshot + start a cloud handoff session

git stash create snapshots the dirty tree without disturbing it (clean tree
hands off HEAD), pushed to refs/ellipsis/handoff/<sha12>; then POST
/v1/sessions with handoff params + the instructions as the prompt. Requires
--parent (the synced laptop session to chain from).

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
hbrooks added a commit that referenced this pull request Jul 5, 2026
…ssion handoff` (stacked on #21) (#22) (#24)

* Laptop transcript sync: agent hooks install/enroll + agent session sync

- agent hooks install|uninstall|status: idempotently manage the Stop +
  SessionEnd command hooks (async, never block a turn) in
  ~/.claude/settings.json, preserving user-authored hooks
- agent hooks enroll|unenroll: per-repo opt-in consent gate, stored in the
  CLI config (cwd -> origin remote -> owner/name)
- agent session sync: hook-driven (stdin JSON) or manual (flags); checks
  enrollment (silent no-op otherwise), redacts client-side, gzips + base64,
  POSTs /v1/sessions/sync; network failures spool to ~/.config/ellipsis/spool
  (latest snapshot per CC session wins) and flush on the next healthy sync;
  every hook-mode failure path is a quiet exit 0 so a sync problem can never
  disturb a Claude Code session

* agent session handoff: push WIP snapshot + start a cloud handoff session

git stash create snapshots the dirty tree without disturbing it (clean tree
hands off HEAD), pushed to refs/ellipsis/handoff/<sha12>; then POST
/v1/sessions with handoff params + the instructions as the prompt. Requires
--parent (the synced laptop session to chain from).

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
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