Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions web/src/components/session/transcript.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
10 changes: 8 additions & 2 deletions web/src/components/session/turns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const TurnTranscript = memo(function TurnTranscript({
stall,
disk,
canManage,
canMove,
startedBy,
me,
projectSlug,
Expand All @@ -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;
Expand Down Expand Up @@ -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]"
/>
</div>,
Expand Down Expand Up @@ -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(
<div key="live">
<LiveTurnView live={live} stall={stall} disk={disk} moves={canManage ? sessionId : undefined} />
<LiveTurnView live={live} stall={stall} disk={disk} moves={canMove ? sessionId : undefined} />
</div>,
);
}
Expand Down
1 change: 1 addition & 0 deletions web/src/routes/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ export function SessionPage() {
stall={stall}
disk={disk}
canManage={isOwner}
canMove={isOwner && !session.review}
startedBy={session.created_by}
me={me?.user.id}
projectSlug={session.project_slug}
Expand Down
Loading