Version 0.9.5, macOS, Node 24.
An agent that starts diffity with --no-open, reviews a diff, and posts comments has no
supported way to open the browser at the session it just worked on.
Opening a known ref is already covered by diffity open [ref]. The gap is the other case: the
agent wants the session its own comments went to, and it cannot name that session as a ref.
To solve this problem an additional command could be implemented.
What happens today
diffity --no-open --quiet main..feature, which the bundled diffity-review skill mandates
in step 1
- The agent reviews and posts comments through
diffity agent comment
- The agent tries to hand the human a URL
At step 3, diffity open with no argument produces /diff with no query, the UI defaults to
ref=work, and a clean checkout shows "No changes found". The human sees an empty page and
concludes the review never ran.
Reconstructing the ref instead does not work reliably. diffity list --json exposes a ref per
instance, but that is the launch ref, and the agent's comments belong to the session named by
current-session. The two disagree whenever anything has touched the pointer since launch,
which a single browser page view is enough to do:
instance launch ref (diffity list): HEAD~1
agent session ref (current-session): main..feature
Passing the launch ref then opens a valid diff of the same files with none of the comments on
it, so the workaround does not just read awkwardly, it silently opens the wrong page.
diffity agent comment writes to current session, so this reaches further than
opening a URL. Navigating to a stale tab with a different ref while a review is running changes the
current session under the agent, and every comment posted after that lands in the stale opened
session instead of the one being reviewed. diffity agent list and diffity agent diff read the
same pointer, so the agent sees the stale session's contents and gets no signal that anything
moved. (I think it worth opening separate issue for this browser tab switching problem)
Proposed behavior
diffity agent open opens the browser at the agent's current session and prints the URL, the way
the other commands do. No arguments. An agent that wants a specific ref already has
diffity open [ref], so there are two commands and no overlap between them.
Example implementation:
agent.command("open")
.description("Open the browser at the agent's current session")
.action(async () => {
const existing = findInstanceForRepo(repoHash);
const ref = getCurrentSession()?.ref;
const qs = ref ? `?${new URLSearchParams({ ref })}` : "";
await open(`http://localhost:${existing.port}/diff${qs}`);
});
The skill needs the same fix
skills/diffity-review/SKILL.md has the problem baked in. Step 1 requires --no-open, which
suppresses the one place the correct ?ref= URL gets printed. Step 4 then runs diffity open <ref>
using the ref argument passed to the skill, which is absent whenever the session came from
--base and --compare. Following the skill exactly on a branch review ends with the human
looking at an empty working tree.
Once agent open exists, step 4 becomes diffity agent open with no ref to reconstruct.
Version 0.9.5, macOS, Node 24.
An agent that starts diffity with
--no-open, reviews a diff, and posts comments has nosupported way to open the browser at the session it just worked on.
Opening a known ref is already covered by
diffity open [ref]. The gap is the other case: theagent wants the session its own comments went to, and it cannot name that session as a ref.
To solve this problem an additional command could be implemented.
What happens today
diffity --no-open --quiet main..feature, which the bundleddiffity-reviewskill mandatesin step 1
diffity agent commentAt step 3,
diffity openwith no argument produces/diffwith no query, the UI defaults toref=work, and a clean checkout shows "No changes found". The human sees an empty page andconcludes the review never ran.
Reconstructing the ref instead does not work reliably.
diffity list --jsonexposes arefperinstance, but that is the launch ref, and the agent's comments belong to the session named by
current-session. The two disagree whenever anything has touched the pointer since launch,which a single browser page view is enough to do:
Passing the launch ref then opens a valid diff of the same files with none of the comments on
it, so the workaround does not just read awkwardly, it silently opens the wrong page.
diffity agent commentwrites to current session, so this reaches further thanopening a URL. Navigating to a stale tab with a different ref while a review is running changes the
current session under the agent, and every comment posted after that lands in the stale opened
session instead of the one being reviewed.
diffity agent listanddiffity agent diffread thesame pointer, so the agent sees the stale session's contents and gets no signal that anything
moved. (I think it worth opening separate issue for this browser tab switching problem)
Proposed behavior
diffity agent openopens the browser at the agent's current session and prints the URL, the waythe other commands do. No arguments. An agent that wants a specific ref already has
diffity open [ref], so there are two commands and no overlap between them.Example implementation:
The skill needs the same fix
skills/diffity-review/SKILL.mdhas the problem baked in. Step 1 requires--no-open, whichsuppresses the one place the correct
?ref=URL gets printed. Step 4 then runsdiffity open <ref>using the ref argument passed to the skill, which is absent whenever the session came from
--baseand--compare. Following the skill exactly on a branch review ends with the humanlooking at an empty working tree.
Once
agent openexists, step 4 becomesdiffity agent openwith no ref to reconstruct.