-
Notifications
You must be signed in to change notification settings - Fork 51
fix(tui,runs): anchor the paused-spec read and confine the replan write on the run's tree #748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5f6f986
850f65d
69e5d5c
68bb84b
e9dbc6a
8c8c2bf
fe25dd6
f9de3cb
a3deb5e
b5525d5
f225517
66d24a8
9d6b52e
46426f7
2ab9f4e
d77a329
0cc7164
27588b4
7c86fc0
5cfca6c
7b7e8c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2917,6 +2917,28 @@ def cmd_resolve(args: argparse.Namespace) -> int: | |
| f"no resolution recorded for {story_key} (agent did not write resolution.json)", | ||
| file=sys.stderr, | ||
| ) | ||
| # `pol` was read BEFORE a session that blocks on a human conversation of | ||
| # arbitrary length, and everything below keys the re-arm on its isolation mode | ||
| # while `_resume_paused_run` at the bottom of this function re-reads policy for | ||
| # the engine. An edit made while the agent was open would therefore re-arm under | ||
| # the old answer and re-drive under the new one — `none -> worktree` re-arms | ||
| # treating the main-checkout edit as reachable, emits no hold, and then mounts a | ||
| # fresh worktree cut from git that cannot see it: the escalation is spent and the | ||
| # story re-wedges. Re-read so the re-arm and the engine agree, which is also what | ||
| # lets the reachability gate below fire against the mode actually in force. | ||
| # Unguarded, exactly like the first load above: nothing has been mutated yet, so | ||
| # an unreadable policy aborts before the re-arm rather than guessing a mode — and | ||
| # `resolution.json` is already on disk, so `--no-interactive` resumes the work. | ||
| isolation_before_session = pol.scm.isolation | ||
| pol = policy_mod.load(_policy_path(project)) | ||
| if pol.scm.isolation != isolation_before_session: | ||
| print( | ||
| f"warning: [scm] isolation changed " | ||
| f"{isolation_before_session} -> {pol.scm.isolation} during the resolve " | ||
| "session; re-arming against the new mode (the agent was told where the " | ||
| "correction had to land under the old one)", | ||
| file=sys.stderr, | ||
| ) | ||
|
|
||
| # resolution.json restore latch: only exists after the session ran, so this | ||
| # arm of the validation cannot be hoisted above it. | ||
|
|
@@ -2989,7 +3011,12 @@ def cmd_resolve(args: argparse.Namespace) -> int: | |
| before_entries = runs.journal_entries_or_none(run_dir) | ||
| hold_resume = False | ||
| try: | ||
| runs.rearm_escalation(run_dir, story_key, restore_patch=restore_patch) | ||
| runs.rearm_escalation( | ||
| run_dir, | ||
| story_key, | ||
| restore_patch=restore_patch, | ||
| isolated_redrive=pol.scm.isolation == "worktree", | ||
|
Comment on lines
+3014
to
+3018
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| ) | ||
| except runs.RearmError as e: | ||
| print(f"error: {e}", file=sys.stderr) | ||
| return 1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the changelog text before merge.
Several entries contain duplicated words or punctuation, including
gone,,,the the,a a, andwhich which. Line 221 also namespolicy.tml; usepolicy.toml. These errors reduce release-note quality and give users an incorrect configuration filename.Also applies to: 194-197, 198-202, 212-223
🤖 Prompt for AI Agents