Skip to content

lab server: stop_program, the first leased action (Slice 5a) - #518

Draft
dayfine wants to merge 1 commit into
agentsfrom
agents-mcp-slice5
Draft

dayfine wants to merge 1 commit into
agentsfrom
agents-mcp-slice5

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Base agents; follows the merged Slice 4 server PRs (#511, #512). The diff shows only this change.

The lab server had leases and tickets (Slice 3) but no tool that changes what the app does. This is Slice 5's first sub-slice from #131: stop_program, the first leased action, as a long operation. ControlPlane.begin_action checks the lease and stores the call once; the pending ticket remembers the app instance it was sent to (SQLite migration 2), and observe resolves it from the app's own transition (stopped with this request id, the run's own end, a UI takeover, or an app restart), so a terminal event is the completion, not the tool's reply. The daemon claims the app's channel with a configured channel_owner (default: the profile, as lc.sh uses) on every action. Tested with lab/server unit tests (158, all fake-lab: retries, restarts, UI takeover, lease loss, app restart, terminal event before the response, busy app, foreign channel owner); no console or app was touched.

Remaining Slice 5 sub-slices:

  • 5b cfr_batch: lease, program stopped, allowlisted lines; marks console://B/save stale (cfr_batch reason). Server-only; it uses the existing channel commands.
  • 5c preflight_program + run_program: needs app-side commands first (follow-up on lab/tooling, not written here): a preflight channel command that stages candidate options, rejects unknown and disabled values, runs dynamic visibility, check_validity and the program's prechecks, and always restores the prior options; and a way to start with options atomically (or select/set/start under one request). Then the daemon's preflight token (instance, panel, options hash, lease) and run_program calling begin_run.
  • 5d: console_state.blocked from the same checks, more race tests (UI takeover during start, app restart between preflight and start), and the console-B soak.

ControlPlane.begin_action stores a leased call once with the lease check;
the pending ticket remembers the app instance (migration 2) and observe
resolves it from the app's terminal transition. stop_program sends a fixed
owner/request/claim/stop request; the channel owner comes from the config.
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