Repository navigation
Optional pane-scoped agterm overlay via REVDIFF_AGTERM_PANE - #303
Merged
Merged
Conversation
REVDIFF_AGTERM_PANE=1 makes launch-revdiff.sh open the review with `agtermctl session overlay open --pane $AGTERM_PANE`, covering the agent's own split pane instead of the whole session so the sibling pane stays live and visible. Opt-in and off by default: it needs the env var, a left/right pane role, a --pane-capable agtermctl (probed via --help, since the flag postdates agterm v0.9.0), and a split confirmed by a window-scoped `tree --json` read. When agterm refuses the pane the launcher retries session-wide, so a version-skewed CLI or a split that disappeared never costs the review.
…ate count A pane agterm promoted into the main slot keeps its baked AGTERM_PANE=right, so promote-then-re-split scopes the overlay to the new sibling rather than the agent's own pane. agterm raises no error there — the pane exists — so the session-wide fallback cannot catch it, and `overlay open` has no --pane-id token to resolve the live role against. Documented beside the gate rather than failing closed, which would drop the feature for everyone. Also corrects the CLAUDE.md bullet, which enumerated three gate conditions where the code has four (the --pane capability probe was left out of the list).
There was a problem hiding this comment.
🟡 Not ready to approve
The new test currently skips entirely when jq isn’t installed, which can silently eliminate coverage of the new pane-overlay behavior in common CI/dev environments.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds an opt-in launcher feature to scope agterm overlays to the agent’s split pane (instead of the entire session) via REVDIFF_AGTERM_PANE=1, keeping the sibling pane visible while reviewing diffs.
Changes:
- Implement
REVDIFF_AGTERM_PANEgating + refusal fallback (--pane left|rightwhen supported, split is confirmed, and pane is valid) in both launcher script copies. - Extend the fake agtermctl backend fixture and add a Go test to cover opt-in, default behavior, no-split behavior, older CLI behavior, and refusal fallback.
- Document the new launcher environment variable across README/site/plugin reference docs and skill docs.
File summaries
| File | Description |
|---|---|
site/docs.html |
Documents the new agterm pane-scoped overlay opt-in in the terminal support section. |
README.md |
Adds a user-facing note describing REVDIFF_AGTERM_PANE=1 and its behavior/tradeoffs. |
plugins/codex/skills/revdiff/SKILL.md |
Updates the Codex skill guidance to mention the opt-in environment variable. |
plugins/codex/skills/revdiff/scripts/launch-revdiff.sh |
Adds pane-support probing, split detection, pane-scoped overlay invocation, and a session-wide retry on specific refusals. |
plugins/codex/skills/revdiff/references/config.md |
Adds reference documentation for REVDIFF_AGTERM_PANE. |
CLAUDE.md |
Captures the design notes/constraints for the pane-scoped overlay behavior and fallback. |
app/testdata/plugin-exit-code/fake-overlay-backend.sh |
Extends the fake agtermctl to support --help probing, split reporting (tree --json), refusal mode, and arg capture. |
app/plugin_exit_code_test.go |
Adds TestAgtermPaneOverlayOptIn and clears additional env vars in cleanOverlayEnv. |
.claude-plugin/skills/revdiff/SKILL.md |
Updates the Claude skill guidance to mention the opt-in environment variable. |
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh |
Mirrors the launcher changes for pane-scoped overlays and refusal fallback. |
.claude-plugin/skills/revdiff/references/usage.md |
Adds usage documentation for REVDIFF_AGTERM_PANE. |
.claude-plugin/skills/revdiff/references/config.md |
Adds config/reference documentation for REVDIFF_AGTERM_PANE. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Comment on lines
+184
to
+186
| if _, err := exec.LookPath("jq"); err != nil { | ||
| t.Skip("the launcher's split check needs jq") | ||
| } |
Deploying revdiff with
|
| Latest commit: |
889c21e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://195f777c.revdiff.pages.dev |
| Branch Preview URL: | https://agterm-pane-overlay.revdiff.pages.dev |
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.
agterm's overlay open now takes
--pane left|right, which scopes an overlay to one split pane and leaves the sibling live and visible. The revdiff launcher always opened a session-wide overlay, so in a split the review covered the other pane's work.REVDIFF_AGTERM_PANE=1opts into the pane-scoped form. Off by default, and unset leaves the agterm branch's call exactly as it was.the gate needs all four of:
REVDIFF_AGTERM_PANE=1$AGTERM_PANEbeingleftorright(scratchis full-coverage, no sibling to spare)--pane-capable agtermctl, probed viaoverlay open --help(the flag postdates agterm v0.9.0)agterm_session_split, a window-scopedtree --jsonread parsed with jqThe tree read is window-scoped because
treedefaults to the frontmost window, which is not the agent's when the user is looking elsewhere. Without jq it reports "not split" and the session-wide overlay stands.fallback: the
--helpprobe reads the PATH agtermctl, which is not always the CLI of the running app. So on a nonzero exit whose agtermctl stderr sayspane overlay already openorpane not visible, the launcher retries session-wide. Nothing is executed twice, the refusal came before revdiff ran, and the grep is gated on agterm's own message precisely so a revdiff failure never triggers a second review.agtermctl's stderr is captured apart from revdiff's (which goes to
$ERR_FILE) and replayed either way. Its stdout is dropped,print_output_and_exitowns the launcher's stdout and that carries annotations alone.known limitation, documented beside the gate:
$AGTERM_PANEis baked into the shell environ at spawn, so a pane agterm promoted into the main slot keepsright. Promote then re-split scopes the overlay to the new sibling instead of this pane, and the fallback cannot catch it because that pane genuinely exists.session statustakes a stable--pane-idtoken for exactly this,overlay opendoes not yet. Failing closed to the session-wide overlay is not the answer, that drops the feature for everyone to avoid a rare misplaced surface the user can see and close.No tint on the pane overlay: revdiff paints its own full TUI, so it never reads as the shell it covered.
TestAgtermPaneOverlayOptIncovers the gate, the fallback and the default path across both launcher copies. The fake agtermctl fixture grew a--helpprobe, atree --jsonreply and a refusal mode. Docs updated in README, site/docs.html, bothconfig.md,usage.md, bothSKILL.mdand CLAUDE.md.