fix(command-ops): add freshness gate before reusing captain workspace - #38
Merged
Conversation
A name-matched cmux workspace was treated as sufficient to send work into, which caused command to resume a stale captain session on a new day. spawn-workspace.sh already handles new-day freshness, but the delegation workflow could bypass it whenever an existing workspace matched by name. Insert an explicit step 3 freshness gate that compares sessions.json[captainName].lastLaunched to today, and require a close + respawn when stale so spawn-workspace.sh's "new day" path runs. Fixes #37
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.
Summary
command-opsdelegation workflow so a name-matched captain workspace isn't reused on a new day.~/.config/cockpit/sessions.jsonand compareslastLaunchedto today; on stale, command closes the workspace and respawns viaspawn-workspace.sh(which already logs↻ new day — starting fresh session).spawn-workspace.shalready handled new-day freshness correctly; the bug was thatcommand-ops/SKILL.mdcould bypass it whenever step 2 (list-workspaces) found a matching name. This PR closes that gap by making the freshness check part of the delegation contract.Fixes #37
Test plan
staleand triggers a respawn.freshand the existing workspace is reused without respawn.sessions.jsonentry for the captain (first-ever launch path): confirm the gate treats it asstaleso step 4 spawns cleanly.