diff --git a/web/src/components/session/transcript.test.tsx b/web/src/components/session/transcript.test.tsx index bffa0dc8..536c36b8 100644 --- a/web/src/components/session/transcript.test.tsx +++ b/web/src/components/session/transcript.test.tsx @@ -185,6 +185,18 @@ describe("the transcript", () => { expect(title).toMatch(/^Runner now hasn't been heard from since .+\.$/); expect(detail).toMatch(/^The agent's work shows up here when it's back/); }); + + it("offers to move the session off a runner whose work doesn't come through only to those who may", () => { + // What MoveOff says under its button, which is mocked here. + const offered = "It starts again on another runner from its branch"; + const owner = render( + turns({ items: [tool()], status: "running", stall, canManage: true, canMove: true }), + ); + expect(owner.textContent).toContain(offered); + // A review agent's session, which its owner manages but can't move. + const review = render(turns({ items: [tool()], status: "running", stall, canManage: true })); + expect(review.textContent).not.toContain(offered); + }); }); describe("a subagent", () => { diff --git a/web/src/components/session/turns.tsx b/web/src/components/session/turns.tsx index ecae187f..ff6a3bd6 100644 --- a/web/src/components/session/turns.tsx +++ b/web/src/components/session/turns.tsx @@ -161,6 +161,7 @@ export const TurnTranscript = memo(function TurnTranscript({ stall, disk, canManage, + canMove, startedBy, me, projectSlug, @@ -184,6 +185,11 @@ export const TurnTranscript = memo(function TurnTranscript({ /** How short of disk the session's runner is. */ disk?: DiskShort; canManage?: boolean; + /** + * Whether the reader may move the session to another runner while its work doesn't come through: + * its owner, unless it is a review agent's session, which takes no move. + */ + canMove?: boolean; /** Who started the session, and who is signed in: a Remote Control link is only for its person. */ startedBy: G.UserRef; me?: G.UserId; @@ -377,7 +383,7 @@ export const TurnTranscript = memo(function TurnTranscript({ live={live} stall={stall} disk={disk} - moves={canManage ? sessionId : undefined} + moves={canMove ? sessionId : undefined} textClassName="pl-[34px]" /> , @@ -415,7 +421,7 @@ export const TurnTranscript = memo(function TurnTranscript({ // The agent went on after the last turn ended, without a message yet: what streams in. rows.push(