Skip to content

Commit 75847de

Browse files
committed
show more
1 parent 0a516ae commit 75847de

9 files changed

Lines changed: 71 additions & 20 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ target
88
.env
99
src-tauri/target
1010
src-tauri/gen
11+
announcement-recordings

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "headroom-desktop",
3-
"version": "0.5.0-rc.4",
3+
"version": "0.5.0-rc.5",
44
"private": true,
55
"type": "module",
66
"scripts": {

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "headroom-desktop"
3-
version = "0.5.0-rc.4"
3+
version = "0.5.0-rc.5"
44
description = "Headroom v1 local-first LLM optimization tray app"
55
authors = ["Codex"]
66
license = "MIT"

src-tauri/src/client_adapters.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,13 @@ pub fn list_client_connectors(
413413
.find(|client| client.id == spec.id)
414414
.map(|client| client.installed)
415415
.unwrap_or(false);
416-
let enabled = is_configured(&setup_state, spec.id);
416+
// Fall back to the remembered snapshot while restore_client_setups
417+
// is still re-applying on launch, so the connector doesn't flash
418+
// "disabled" during the async restore window after a restart.
419+
let enabled = is_configured(&setup_state, spec.id)
420+
|| setup_state
421+
.remembered_clients
422+
.contains_key(normalized_setup_id(spec.id));
417423
let verified = if enabled {
418424
verify_client_setup(spec.id)
419425
.map(|result| result.verified)

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "Headroom",
4-
"version": "0.5.0-rc.4",
4+
"version": "0.5.0-rc.5",
55
"identifier": "com.extraheadroom.headroom",
66
"build": {
77
"beforeDevCommand": "npm run dev",

src/components/ActivityFeed.test.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,40 @@ describe("formatRequestMessages", () => {
826826
).toBe("assistant:\ndone, running it:\n[tool_use]");
827827
});
828828

829+
it("surfaces tool_result payload from block.content so compression is diffable", () => {
830+
// kompress shrinks the *content* of tool_result blocks. That payload lives
831+
// in `block.content` (string or nested text blocks), not `block.text`, so
832+
// it must be flattened — otherwise both diff sides render a bare
833+
// [tool_result] and the diff shows no change.
834+
expect(
835+
formatRequestMessages([
836+
{
837+
role: "user",
838+
content: [
839+
{ type: "tool_result", tool_use_id: "x", content: "huge tool output here" }
840+
]
841+
}
842+
])
843+
).toBe("user:\nhuge tool output here");
844+
expect(
845+
formatRequestMessages([
846+
{
847+
role: "user",
848+
content: [
849+
{
850+
type: "tool_result",
851+
tool_use_id: "x",
852+
content: [
853+
{ type: "text", text: "line one" },
854+
{ type: "text", text: "line two" }
855+
]
856+
}
857+
]
858+
}
859+
])
860+
).toBe("user:\nline one\nline two");
861+
});
862+
829863
it("labels a missing role as (unknown) instead of rendering a bare newline", () => {
830864
expect(formatRequestMessages([{ content: "orphan content" }])).toBe(
831865
"(unknown):\norphan content"

src/components/ActivityFeed.tsx

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -269,20 +269,30 @@ function workspaceBasename(path: string | null | undefined): string | null {
269269
// shown as a short `[type]` marker rather than dropped, so the reader sees
270270
// that something was there.
271271
function messageText(msg: TransformationRequestMessage): string {
272-
const c = msg.content;
272+
return flattenContent(msg.content);
273+
}
274+
275+
// Flatten a message/block `content` value to text. `tool_result` blocks carry
276+
// their (compressible) payload in `block.content` — a string or a nested block
277+
// list — not in `block.text`, so without recursing here both the original and
278+
// compressed sides render as a bare `[tool_result]` and the diff sees no change.
279+
function flattenContent(c: unknown): string {
273280
if (typeof c === "string") return c;
274-
if (Array.isArray(c)) {
275-
return c
276-
.map((block) => {
277-
if (!block || typeof block !== "object") return "";
278-
if (typeof block.text === "string") return block.text;
279-
if (typeof block.type === "string") return `[${block.type}]`;
280-
return "";
281-
})
282-
.filter((s) => s.length > 0)
283-
.join("\n");
284-
}
285-
return "";
281+
if (!Array.isArray(c)) return "";
282+
return c
283+
.map((block) => {
284+
if (!block || typeof block !== "object") return "";
285+
const b = block as { type?: unknown; text?: unknown; content?: unknown };
286+
if (typeof b.text === "string") return b.text;
287+
if (b.content !== undefined) {
288+
const inner = flattenContent(b.content);
289+
if (inner.length > 0) return inner;
290+
}
291+
if (typeof b.type === "string") return `[${b.type}]`;
292+
return "";
293+
})
294+
.filter((s) => s.length > 0)
295+
.join("\n");
286296
}
287297

288298
export function formatRequestMessages(messages: TransformationRequestMessage[]): string {

0 commit comments

Comments
 (0)