Repository navigation
feat(serve): run, read and cancel a mission over serve - #964
Merged
Merged
Conversation
POST /missions starts a mission as its own session on a background thread through the CLI loop; GET /missions/{id} reads it; POST /missions/{id}/cancel cancels it. The verify command, budget ceilings, workspace, allow list and sandbox are owner configuration, never request fields.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Missions over serve:
POST /missions {goal, max_steps?, max_minutes?, max_tokens?}starts a mission (202 {id, status: "running"}),GET /missions/{id}reads its status andfact/missionsummary,POST /missions/{id}/cancelcancels it.Why
Last operation of #947 (step 5 of #941). The route is
/missions, not/sessions/{id}/missionas the issue sketched: a mission is its own session (its own pinned mission prompt and writer lock), so it cannot run on a live serve session. The verify command runs a process, so it stays the owner's configuration.Changes
serve/missions.rs(new): the three routes. The mission runs the CLI's loop (mission::run_mission_outcome, from refactor(mission): return how a mission ended instead of printing and exiting #961) on a background thread over the serve workspace root. One mission at a time (409). Write approvals queue in the existingGET /approvalsqueue under the mission id (the registry is the server-session roster with the serveQueueApprover).[mission]of the user config, read at serve start liketole mission), the budget ceilings (thetole missiontier or configmax_*; a request may ask for less, a larger value is a400), the workspace, allow list, sandbox and profile. A body with averifykey, or any key besides the four named, is a400and starts nothing. A--plan-modeserver answers409.main.rspasses the settings intoServeConfig;serve.rsholds the table of missions and the route arms;mission.rsscopes a dead-code allowance to builds without serve.docs/mobile-control.mdrows and a CHANGELOG entry (Added, Behavior Change).Testing
tests/serve_mission_e2e.rsagainst the realtole servewith a mock provider: runs to its budget and reports the summary (and the session file carries the register); bad bodies are400, unknown missions404, no session file left behind; a slow mission isrunning, a second is409, cancel ends it asstopped, a second cancel is409, no token is401; a write waits in/approvals?session=<mission id>; the verify command comes from the user config (falsefails three times,verify_failed) while averifyin the body is a400for every value.mission_routes_refuse_owner_fields_and_keep_one_mission_at_a_time.cargo fmt, clippy-D warningsin the default,--no-default-featuresand--no-default-features --features shell-toolsprofiles; fullcargo test -p tole-clipasses in the default profile and with--no-default-features.