Repository navigation
refactor(mission): return how a mission ended instead of printing and exiting - #961
Merged
Merged
Conversation
… exiting run_mission_outcome runs the loop and returns a MissionOutcome; run_mission keeps the console report and the nonzero exit. MissionConfig gains fresh_id so a face can know the session id up front. No change to the CLI.
🔍 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
Split the mission loop so it returns a result:
run_mission_outcomeruns the loop, writes thefact/missionsummary and returns aMissionOutcome;run_missioncalls it and keeps the console report and the nonzero exit for a mission that did not complete.MissionConfiggainsfresh_id(the CLI passesNone).Why
Prerequisite for mission over serve (#947, step 5 of #941): a daemon has to run a mission on a thread and report its end, and cannot print and exit. This change alone has no behavior change.
Changes
mission.rs:MissionOutcome,run_mission_outcome, thinrun_missionwrapper;fresh_idlets a caller know the session id before the loop runs.main.rs: passesfresh_id: None.Testing
The existing
mission_e2esuite passes unchanged (9 passed, 0 failed), and so does the fullcargo test -p tole-cli(no failing result line).cargo fmtandcargo clippy -p tole-cli --all-targets -- -D warningsare clean in the default,--no-default-featuresand--no-default-features --features shell-toolsprofiles.