Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c736790
perf(agents): mount transcript detail bodies on first expansion
LordMelkor Nov 21, 2026
2d5aec0
test(goose): expand the transcript prompt before checking its body
LordMelkor Nov 21, 2026
69fbe75
test(markdown): check trust rules in the expanded transcript reply
LordMelkor Nov 21, 2026
d93deb3
Show recent Claude activity before loading earlier turns
LordMelkor Nov 21, 2026
30f1d7b
Hold the reading position when a session prompt moves
LordMelkor Nov 21, 2026
2542d22
Contain transcript row painting while an agent works
LordMelkor Nov 21, 2026
a3e2424
Contain transcript painting around each turn
LordMelkor Nov 21, 2026
3d81b1c
Align transcript notes and exercise focused Claude history reads
LordMelkor Nov 21, 2026
290f1ff
Update loaded Claude history from the tail when work starts or stops
LordMelkor Nov 21, 2026
01cb4c2
Keep the Claude session prompt on the first visible turn
LordMelkor Nov 21, 2026
3f46b54
Keep Claude working transcript reads in the plugin
LordMelkor Nov 21, 2026
1b81714
Honor queued Claude transcript refreshes across working changes
LordMelkor Nov 21, 2026
737542a
Honor manual transcript refreshes across interrupted live reads
LordMelkor Nov 21, 2026
2dfe27c
perf(agents): reuse unchanged transcript turns and reply Markdown
LordMelkor Nov 22, 2026
de3bf6d
Load earlier Claude activity when refreshing a preview
LordMelkor Nov 22, 2026
aa524c5
Model Claude transcript reads and refresh intent explicitly
LordMelkor Nov 22, 2026
87d47ca
Exercise Claude overlap cancellation through the mounted panel
LordMelkor Nov 22, 2026
c4a2053
Name the mounted Claude overlap regression for its behavior
LordMelkor Nov 22, 2026
5ea965a
Wait for the working Claude page in the divider test
LordMelkor Nov 22, 2026
066224c
Wait for each real file read in the Claude divider test
LordMelkor Nov 22, 2026
2e751d6
Merge transcript turn and reply memoization
LordMelkor Nov 22, 2026
cf74850
Merge Claude transcript reader transitions with turn memoization
LordMelkor Nov 22, 2026
80ac8df
Keep equal transcript turns and snapshots across reads
LordMelkor Nov 22, 2026
31693ad
Read loaded Claude history in full when work starts or stops
LordMelkor Nov 22, 2026
6fe2dc6
Render expanded transcript replies directly
LordMelkor Nov 22, 2026
f333a00
Limit Claude preview fallback to missing or disjoint polls
LordMelkor Nov 22, 2026
914edab
Use the transcript people context value directly
LordMelkor Nov 22, 2026
451d26b
Read recent Claude activity when a loaded turn finishes
LordMelkor Nov 22, 2026
9e24fb6
Guard the working transcript status row against horizontal overflow
LordMelkor Nov 22, 2026
ad0c834
Show the transcript window notice when a live read drops a turn
LordMelkor Nov 22, 2026
7fa2a39
Open large Codex transcripts on the latest activity
LordMelkor Nov 22, 2026
332986d
Keep the visible Codex turns when a conversation starts another thread
LordMelkor Nov 22, 2026
cabd5d2
Read appended records in an oversized working Claude turn
LordMelkor Nov 22, 2026
e8184dc
Clear the oversized read cooldown when a working turn can resume
LordMelkor Nov 22, 2026
adc8a03
Cover a successful send across Claude transcript polls
LordMelkor Nov 22, 2026
bd43030
Compare working Claude transcript polls with full reads
LordMelkor Nov 22, 2026
4479582
Keep focus in the transcript when earlier activity opens
LordMelkor Nov 22, 2026
c9c9611
Merge main into the transcript preview branch
LordMelkor Nov 22, 2026
8d1289d
Prune duplicate transcript assertions and exercise the linked reply body
LordMelkor Nov 22, 2026
acee353
Merge main into the transcript preview branch
LordMelkor Nov 22, 2026
3cb371b
Restore equal Refresh and linked arrival regression checks
LordMelkor Nov 23, 2026
c760f6e
Merge main into transcript preview branch
LordMelkor Nov 23, 2026
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
2 changes: 2 additions & 0 deletions docs/buzz-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ if that desktop app is up and running.
**Settings → Agent setup → Harness defaults**.
- **An agent's page** has its identity and instructions, settings, **Memory**,
**Activity** (its past sessions) and plugin tabs such as **Attention**.
Local Claude and Codex transcripts can open on recent activity. Choose
**Load earlier activity** to see more history.
- **Instructions** change how an agent behaves. They don't give it new tools,
accounts or permissions.
- **Sessions.** By default an agent starts a fresh conversation for each
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-authoring-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ entry has a unique `id`, a `label`, and an `onSelect` callback.
heading. With `placement: "team-row"`, the channel group uses the native
Team menu and ignores these entries.

For `ctx.agents.ui.Transcript`, give each turn a unique `turnId` that stays the same across reads. Return a new turn when it changes. Leave previously returned turns and their items untouched.

## Migration writes

Check `ctx.relay.snapshot().session.supportsMigrationWrites === true` before
Expand Down
66 changes: 66 additions & 0 deletions src/bundled/TranscriptPreviewNotice.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { Component, createRef } from "react";
import { Button } from "../shared/design-system/ui/Button";

type FocusTarget = { refresh: HTMLButtonElement; focusVisible: boolean };

export class TranscriptPreviewNotice extends Component<{
partial: boolean;
loading?: boolean;
onLoad(): void;
}> {
private load = createRef<HTMLButtonElement>();

getSnapshotBeforeUpdate() {
const button = this.load.current;
if (
this.props.partial ||
!button ||
button.ownerDocument.activeElement !== button
)
return null;
const refresh = button
.closest("[data-transcript]")
?.querySelector<HTMLButtonElement>(
'[data-transcript-header] button[aria-label="Refresh transcript"]',
);
return refresh
? { refresh, focusVisible: button.matches(":focus-visible") }
: null;
}

componentDidUpdate(
_previous: unknown,
_state: unknown,
target?: FocusTarget | null,
) {
if (
target?.refresh.isConnected &&
target.refresh.ownerDocument.activeElement ===
target.refresh.ownerDocument.body
) {
const options = {
preventScroll: true,
focusVisible: target.focusVisible,
};
target.refresh.focus(options);
}
}

render() {
if (!this.props.partial) return null;
return (
<div className="text-body-sm text-subtle">
Earlier activity is not loaded.{" "}
<Button
ref={this.load}
variant="plain"
size="inline"
loading={this.props.loading ?? false}
onClick={this.props.onLoad}
>
Load earlier activity
</Button>
</div>
);
}
}
72 changes: 64 additions & 8 deletions src/bundled/claude-code/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ import {
readLatestTurns,
readSessionTitle,
readTranscript,
readTranscriptPreview,
withNotices,
type ClaudeTranscript,
type WorkingPoll,
type Conversation,
type SessionsPlace,
} from "./transcript";
Expand Down Expand Up @@ -841,6 +844,7 @@ export class ClaudeRuntime {
workspace: string,
working: boolean,
signal: AbortSignal,
poll?: WorkingPoll,
) {
if (await this.inspect?.(conversation.agent))
// Where the gateway would attribute it, also say that it isn't.
Expand All @@ -849,20 +853,70 @@ export class ClaudeRuntime {
? `${REMOTE_TRANSCRIPTS}. They aren't attributed in the agent gateway yet.`
: `${REMOTE_TRANSCRIPTS}.`,
);
return this.readActivity(
readTranscript,
conversation,
workspace,
working,
signal,
undefined,
poll,
);
}

async transcriptPreview(
conversation: Conversation,
workspace: string,
working: boolean,
signal: AbortSignal,
) {
const { agent, sessionId } = conversation;
const key = conversation.community
? COMMUNITY_SESSION
: conversationKey(conversation.channelId, conversation.root);
const saved = () => this.savedSessions(agent).get(key)?.id;
if (
!sessionId ||
saved() !== sessionId ||
!this.host.spawn ||
this.target ||
this.bound(agent) ||
(await this.inspect?.(agent))
)
return undefined;
signal.throwIfAborted();
const preview: ClaudeTranscript | undefined = await this.readActivity(
readTranscriptPreview,
conversation,
workspace,
working,
signal,
key,
);
signal.throwIfAborted();
return saved() === sessionId && !this.bound(agent) ? preview : undefined;
}

private readActivity(
read: typeof readTranscript,
conversation: Conversation,
workspace: string,
working: boolean,
signal: AbortSignal,
key = conversation.community
? COMMUNITY_SESSION
: conversationKey(conversation.channelId, conversation.root),
poll?: WorkingPoll,
) {
const prompts = this.prompts(conversation.agent);
return readTranscript(
return read(
this.spawn,
this.place(
conversation.agent,
conversation.community
? COMMUNITY_SESSION
: conversationKey(conversation.channelId, conversation.root),
workspace,
),
this.place(conversation.agent, key, workspace),
conversation,
working,
signal,
(pubkey) => this.reads(conversation.agent)?.name(pubkey),
poll,
).then(
(transcript) =>
transcript && {
Expand Down Expand Up @@ -896,6 +950,7 @@ export class ClaudeRuntime {
working: boolean,
signal: AbortSignal,
held: readonly TranscriptTurn[],
poll?: WorkingPoll,
) {
if (await this.inspect?.(conversation.agent)) return undefined;
const read = await readLatestTurns(
Expand All @@ -911,6 +966,7 @@ export class ClaudeRuntime {
working,
signal,
(pubkey) => this.reads(conversation.agent)?.name(pubkey),
poll,
);
if (!read) return undefined;
// Turns older than all `held` keeps are left.
Expand Down
135 changes: 135 additions & 0 deletions src/bundled/claude-code/tabs-overlap.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
// @vitest-environment jsdom
import "@testing-library/jest-dom/vitest";
import {
act,
cleanup,
fireEvent,
render,
screen,
} from "@testing-library/react";
import { afterEach, expect, it, vi } from "vitest";
import { LIVE_READ_MS } from "../../features/agents/TranscriptPanel";
import type { TranscriptTurn } from "../../features/agents/activity-transcript";
import type { Agent } from "../../features/agents/service";
import { ClaudeDefaults } from "./defaults";
import { ClaudeRuntime, type Config, DEFAULT_CONFIG } from "./runtime";
import { ClaudeSetup } from "./setup";
import { createTabs } from "./tabs";

const agent: Agent<Config> = {
key: "c".repeat(64),
pubkey: "c".repeat(64),
owner: "a".repeat(64),
name: "Claude",
type: "buzz.claude-code/claude-code",
relay: "wss://example.org",
place: "here",
config: DEFAULT_CONFIG,
attention: {},
skipped: {},
timers: {},
attentionEnabled: false,
};

afterEach(() => {
cleanup();
vi.restoreAllMocks();
vi.useRealTimers();
localStorage.clear();
});

function turn(text: string, at: number) {
return {
turnId: text,
startedAt: at,
channelId: "channel",
threadRootId: null,
triggeringEventIds: [],
sessionId: "kept",
newSession: false,
config: [],
partial: false,
items: [{ id: text, at, type: "prompt", text, sections: [], steer: false }],
} satisfies TranscriptTurn;
}

function deferred<T>() {
let resolve!: (value: T) => void;
const promise = new Promise<T>((complete) => {
resolve = complete;
});
return { promise, resolve };
}

it("loads full Claude history when work stops after a poll observes invalid overlap", async () => {
vi.useFakeTimers();
localStorage.setItem(
"buzz.claude-code.sessions.v1",
JSON.stringify({
[agent.key]: { channel: { id: "kept", seen: 0, at: 1 } },
}),
);
const runtime = new ClaudeRuntime(
{},
() => undefined,
async () => undefined,
);
const sessions = vi
.spyOn(runtime, "sessions")
.mockReturnValue([{ key: "channel", busy: true }]);
const next = turn("Latest after the stop", 3);
const finish = deferred<void>();
vi.spyOn(runtime, "transcriptPreview")
.mockResolvedValueOnce({
turns: [turn("Previewed activity", 2)],
more: true,
})
.mockImplementation(async () => {
await finish.promise;
return { turns: [next], more: true };
});
vi.spyOn(runtime, "transcript").mockImplementation(async () => {
await finish.promise;
return { turns: [turn("Earlier history", 1), next], more: false };
});
const poll = deferred<TranscriptTurn[]>();
let pollSignal: AbortSignal | undefined;
vi.spyOn(runtime, "latestTurns").mockImplementationOnce(
(_, _workspace, _working, signal) => {
pollSignal = signal;
return poll.promise;
},
);
const { ActivityTab } = createTabs({
runtime,
defaults: new ClaudeDefaults(),
setup: new ClaudeSetup(undefined),
});
const view = () => <ActivityTab agent={agent} />;
const { rerender } = render(view());
const load = "Load earlier activity";
const summary = { selector: "summary span" };
await act(async () => {
fireEvent.click(screen.getByRole("button", { name: /^View transcript/ }));
});
expect(screen.getByText("Previewed activity", summary)).toBeVisible();
expect(screen.getByRole("button", { name: load })).toBeVisible();

act(() => vi.advanceTimersByTime(LIVE_READ_MS));
expect(pollSignal?.aborted).toBe(false);
const stop = poll.promise.then(() => {
sessions.mockReturnValue([{ key: "channel", busy: false }]);
rerender(view());
expect(pollSignal?.aborted).toBe(true);
});
poll.resolve([next]);
try {
await stop;
} finally {
await act(async () => finish.resolve());
}

expect(screen.getByText("Latest after the stop", summary)).toBeVisible();
expect(screen.getByText("Earlier history", summary)).toBeVisible();
expect(screen.queryByRole("button", { name: load })).toBeNull();
});
Loading
Loading