A malformed file image URL breaks transcript rendering

This commit is contained in:
Ian Gulliver
2026-10-16 14:31:25 -07:00
parent 9f9556b1e4
commit ca24f2cabb
4 changed files with 12 additions and 5 deletions
-2
View File
@@ -1,7 +1,5 @@
# Bugs # Bugs
- A malformed file image URL breaks transcript rendering
`decodeURI` throws on e.g. `file:///tmp/100%.png` (`web/src/markdown.ts:347`), and `renderAll` appends events before mounting the composer (`web/src/task.ts:608–609`), so the rest of the transcript and the composer don't render. Catch the decode error and render the plain fallback link.
- operations.md describes two incompatible event-stream designs - operations.md describes two incompatible event-stream designs
`docs/operations.md:320–324` says selecting tasks opens dedicated SSE streams, which is stale against `web/src/state.ts:309–340`, `:401–414`, and says only `agent.delta` is transient though `admin.health` is too. Rewrite the Events section to match the current two-stream feed design, and qualify the transaction/event guarantee at `docs/operations.md:7` for internal bookkeeping writes. `docs/operations.md:320–324` says selecting tasks opens dedicated SSE streams, which is stale against `web/src/state.ts:309–340`, `:401–414`, and says only `agent.delta` is transient though `admin.health` is too. Rewrite the Events section to match the current two-stream feed design, and qualify the transaction/event guarantee at `docs/operations.md:7` for internal bookkeeping writes.
+6 -1
View File
@@ -311,7 +311,12 @@ function worktreeImageURL(path, taskId) {
} }
let file = path; let file = path;
if (/^file:\/\//i.test(file)) { if (/^file:\/\//i.test(file)) {
file = decodeURI(file.slice("file://".length)); try {
file = decodeURI(file.slice("file://".length));
}
catch {
return null;
}
} }
else if (/^[a-z][a-z0-9+.-]*:/i.test(file)) { else if (/^[a-z][a-z0-9+.-]*:/i.test(file)) {
return null; return null;
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -351,7 +351,11 @@ function worktreeImageURL(path: string, taskId: string | undefined): string | nu
} }
let file = path; let file = path;
if (/^file:\/\//i.test(file)) { if (/^file:\/\//i.test(file)) {
file = decodeURI(file.slice("file://".length)); try {
file = decodeURI(file.slice("file://".length));
} catch {
return null;
}
} else if (/^[a-z][a-z0-9+.-]*:/i.test(file)) { } else if (/^[a-z][a-z0-9+.-]*:/i.test(file)) {
return null; return null;
} }