Repository navigation
fix(perf): correct three 07-27 perf regressions - #11234
Conversation
Greptile SummaryThis PR corrects three performance regressions introduced on 07-27: a workspace scan capacity bug that falsely reported valid projects as "Unavailable", repeated full base64-decoding of repo icons on every 250ms dashboard publish, and a frozen pop-out board caused by any single over-long card label silently discarding the entire snapshot.
Confidence Score: 5/5All three regressions are cleanly fixed and their corrections do not weaken any pre-existing contract. The scan budget, icon cache, and pop-out admission changes are each independently bounded in scope and well-tested. The entry-cap change is mechanically straightforward — Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/shared/workspace-space-scan-budget.ts | Fixes scan capacity regression: removes the traversal-wide entries counter from WorkspaceSpaceScanBudget, changes the entry cap to a per-listing check (listingEntryCount >= limits.maxEntries), and splits parent-path charging into a per-listing estimateWorkspaceSpaceListingRetainedBytes helper charged once on the first entry rather than once per entry. |
| src/main/ipc/dashboard-payload-validation.ts | Adds admitDashboardSnapshot (per-card filter) and a module-scoped BoundedMap icon-validity cache; isIcon memoizes the image branch on a length-prefixed source + src key that is proven collision-safe; the new DASHBOARD_MAX_LABEL_LENGTH constant is shared with the producer. |
| src/main/ipc/dashboard-popout.ts | Replaces isDashboardSnapshot with admitDashboardSnapshot in the publish handler; adds console.warn logging for both outright rejections and per-card drops; icon carry-forward and wire payload remain unchanged. |
| src/renderer/src/components/dashboard/build-dashboard-snapshot.ts | Adds boundedLabel/boundedLabelOrUndefined helpers and applies them to repoName, worktreeName, conversationName, and snapshot-level filterOptions.projects[].label. task, lastUserMessage, and lastAgentMessage are intentionally left unbounded here as they are already capped upstream. |
| src/shared/workspace-space-entry-traversal.ts | Updates retireFrame to call releaseWorkspaceSpaceScanEntries with the new single-argument signature; consistent with the budget type change. |
| src/shared/dashboard-snapshot.ts | Exports DASHBOARD_MAX_LABEL_LENGTH = 1_024 as the single source of truth shared between producer and validator. |
Reviews (3): Last reviewed commit: "fix(dashboard): disambiguate the repo ic..." | Re-trigger Greptile
📝 WalkthroughWalkthroughDashboard snapshots now bound card and project labels, cache repeated image-icon validation, admit valid cards while dropping invalid ones, and preserve prior popout state for malformed snapshots. Workspace scan budgeting now charges parent-path retention once per directory listing, removes traversal-wide entry counting, and enforces directory-shape limits. Tests cover admission, caching, retained-byte limits, concurrency, and root-path independence, while documentation reflects the revised per-listing accounting. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/shared/workspace-space-scan-budget.ts (1)
15-19: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTrim the explanatory TypeScript comments. These comments repeat behavior already expressed by the adjacent code and test names; keep only concise, non-obvious rationale.
src/shared/workspace-space-scan-budget.ts#L15-L19: reduce to a short contract statement.src/shared/workspace-space-scan-budget.ts#L63-L68: replace with a one-line reason for charging parent paths once.src/shared/workspace-space-scan-budget.ts#L121-L122: remove or collapse to one line.src/shared/workspace-space-entry-traversal.test.ts#L194-L197: rely on thedescribename or use one concise line.src/shared/workspace-space-entry-traversal.test.ts#L227-L228: remove; the parameterized test states this.src/shared/workspace-space-entry-traversal.test.ts#L251-L254: reduce to one concise byte-cap rationale.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 62b6835d-9fc3-4598-8305-bdf8b65e5f5b
📥 Commits
Reviewing files that changed from the base of the PR and between a8126a0 and 6ecabf4aa6c9b156e8d12d2da7d1ea2950e48181.
📒 Files selected for processing (11)
docs/workspace-space-scan-resource-bounds.mdsrc/main/ipc/dashboard-payload-validation.test.tssrc/main/ipc/dashboard-payload-validation.tssrc/main/ipc/dashboard-popout.test.tssrc/main/ipc/dashboard-popout.tssrc/renderer/src/components/dashboard/build-dashboard-snapshot.test.tssrc/renderer/src/components/dashboard/build-dashboard-snapshot.tssrc/shared/dashboard-snapshot.tssrc/shared/workspace-space-entry-traversal.test.tssrc/shared/workspace-space-scan-budget.test.tssrc/shared/workspace-space-scan-budget.ts
Traversal capacity cap no longer scales with worker concurrency (stablyai#11026). retainWorkspaceSpaceScanEntry charged a traversal-wide entry counter, so N workers each holding a listing multiplied the live charge. At concurrency 48 a 48x2,100 tree (100,848 entries) hit the 100,000 cap while 100x1,500 (150,100 entries, 50% more) passed, and scanLocalWorktree treats the capacity error as terminal, reporting an intact worktree as "Unavailable" with sizeBytes 0. The cap is now per directory listing -- the only quantity fixed by directory shape -- restoring the invariant docs/workspace-space-scan-resource-bounds.md already states. Aggregate live retention stays bounded by the unchanged 64 MiB byte cap. Note: releasing each entry's charge at dispatch (the originally suggested fix) was measured and does not help; the peak is set at admission, before any entry is dispatched. Repo image icons are no longer fully base64-decoded on every snapshot publish (stablyai#11012). sanitizeRepoIcon reached decodeBase64Prefix, which sized its buffer to the whole payload to read a 24-byte header, running synchronously inside ipcMain.handle at a 250 ms throttle. Validation is now memoized on source+src in a BoundedMap. Measured for 10 icons x 256 KB: 37.34 ms -> 0.67 ms per publish. One over-long card label no longer discards the entire snapshot (stablyai#11012). isDashboardSnapshot was all-or-nothing and dashboard-popout returned early with no log while replaying lastSnapshot, so `orca terminal rename --title "<1025+ chars>"` froze the pop-out board on its last good paint with nothing surfaced. Labels are truncated at the producer, the validator drops only the offending card, and both the rejection and the drop are logged. The bound now lives in the shared snapshot contract so producer and validator cannot drift. Co-authored-by: Orca <[email protected]>
The 4.1 fix made the entry cap per-listing but left the 64 MiB byte cap charging parentPath.length for every entry in a listing. Because a listing's entries all share one parent-path string, that multiplied the path by the directory's width, so the byte cap measured checkout depth rather than live heap. The reported symptom therefore still reproduced at the production default limits: 48 x 2,100 @ concurrency 48 raised a capacity error once the worktree path passed ~58 characters, while the same layout at concurrency 1 succeeded. The shipped regression test could not see this because it passes maxRetainedBytes: Number.MAX_SAFE_INTEGER, disabling the only cap still in play. Measured at a real 65-char worktree root, 3 of the report's 4 documented layouts still failed. The parent path is now charged once per listing, with its first entry, so an empty listing strands no charge. Per-entry overhead is unchanged at 512 B + name, which still dominates the estimate, so the OOM protection the original PR added is preserved. Adds a production-default-limits case covering the report's layouts under a deep root, plus an assertion that a short and a deep root reach the same verdict -- the path independence docs/workspace-space-scan-resource-bounds.md requires and which no existing test enforced. Co-authored-by: Orca <[email protected]>
The caching test asserted a per-publish millisecond budget, which failed on CI at 5.64 ms against a 5 ms ceiling. Any threshold flakes on a loaded box, so count real sanitizeRepoIcon entries instead: 10 repos x 20 publishes is 200 icon checks against exactly 1 decode. Added cases pin the cache key (payload and source both re-decode; a cached image verdict never answers for an emoji) and that a rejection is cached too. Also drops budget.entries, which the per-listing cap left as a traversal-wide counter no check reads -- exactly the shape a future guard could reintroduce the concurrency bug from. Co-authored-by: Orca <[email protected]>
stablyai#11042 added snapshot-level filterOptions whose project labels are repo.displayName -- the same unbounded source this PR already bounds for card.repoName, but one level up where dropping a card cannot recover it. An over-long project name would fail isDashboardFilterOptions and take the entire snapshot with it, which is the exact frozen-board failure the per-card drop was added to end. Workspace-status labels are already capped at 32 by workspace-statuses.ts, so only projects needed this. Co-authored-by: Orca <[email protected]>
6ecabf4 to
02a2ac9
Compare
Review responses@greptile-apps —
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Locate relevant files =='
fd -t f . src | rg 'workspace-space-(scan-budget|entry-traversal)|dashboard.*(validation|snapshot)|build-dashboard-snapshot|agent-status|orchestration|workspace-status'
echo
echo '== Workspace budget API and stale entries references =='
rg -n -C 3 '\b(entries|releaseWorkspaceSpaceScanEntries|retainWorkspaceSpaceScanEntry|createWorkspaceSpaceScanBudget)\b' \
src/shared/workspace-space-scan-budget.ts \
src/shared/workspace-space-entry-traversal.ts \
src/shared/workspace-space-scan-budget.test.ts \
src/shared/workspace-space-entry-traversal.test.ts || true
echo
echo '== Dashboard filter options producer/validator and label-bound assertions =='
rg -n -C 4 '\b(filterOptions|projects|DASHBOARD_MAX_LABEL_LENGTH|boundedLabel|isDashboardFilterOptions)\b' \
src/renderer/src/components/dashboard \
src/main/ipc/dashboard-payload-validation.ts \
src/shared/dashboard-snapshot.ts || true
echo
echo '== Icon validation cache and deterministic decode-count test seam =='
rg -n -C 4 '\b(decode|sanitizeRepoIcon|repoIcon|BoundedMap|isDashboardSnapshot)\b' \
src/main/ipc/dashboard-payload-validation.ts \
src/main/ipc/dashboard-payload-validation.test.ts || true
echo
echo '== Status-field normalization and dashboard card construction =='
rg -n -C 3 '\b(normalizeAgentStatusObject|normalizePromptField|normalizeOptionalMultilineField|AGENT_STATUS_MAX_FIELD_LENGTH|AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH|buildOrchestrationTaskDisplayMetadata|ORCHESTRATION_TASK_TITLE_MAX_LENGTH|taskTitle)\b' \
src \
-g '*.ts' || trueLength of output: 135608 The PR description image shows the Orca app in a dark theme with the
The deterministic assertion is a stronger and less flaky replacement for the timing threshold. |
|
The concern about the test was unfounded: Everything looks correct. All three original issues are resolved:
LGTM. Tip: You can customize Greptile's behavior for this repo with |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5855a8a1-6e2c-48e1-bb10-5e84169e77d1
📥 Commits
Reviewing files that changed from the base of the PR and between 6ecabf4aa6c9b156e8d12d2da7d1ea2950e48181 and 02a2ac9.
📒 Files selected for processing (12)
docs/workspace-space-scan-resource-bounds.mdsrc/main/ipc/dashboard-payload-validation.test.tssrc/main/ipc/dashboard-payload-validation.tssrc/main/ipc/dashboard-popout.test.tssrc/main/ipc/dashboard-popout.tssrc/renderer/src/components/dashboard/build-dashboard-snapshot.test.tssrc/renderer/src/components/dashboard/build-dashboard-snapshot.tssrc/shared/dashboard-snapshot.tssrc/shared/workspace-space-entry-traversal.test.tssrc/shared/workspace-space-entry-traversal.tssrc/shared/workspace-space-scan-budget.test.tssrc/shared/workspace-space-scan-budget.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- src/shared/dashboard-snapshot.ts
- src/renderer/src/components/dashboard/build-dashboard-snapshot.ts
- src/shared/workspace-space-scan-budget.test.ts
- src/main/ipc/dashboard-popout.ts
- src/main/ipc/dashboard-payload-validation.ts
- src/shared/workspace-space-entry-traversal.test.ts
The memoization key joined `source` and `src` with a space, but the sanitizer's base64 pattern admits whitespace inside a valid `src`. A rejected icon can therefore split the same concatenation differently and inherit an accepted icon's cached verdict, reaching the pop-out's `<img src>` without ever being sanitized. Length-prefix the source. Co-authored-by: Orca <[email protected]>
Pre-merge gate — one defect found and fixed, everything else verifiedVerified independently rather than from the report: CI green on Defect found: the icon cache key was ambiguous
`${candidate.source} ${candidate.src}`but The value lands in Fixed by length-prefixing the key so the split point is unambiguous: `${candidate.source.length}:${candidate.source}${candidate.src}`Added Everything else checked out
Verdict: safe to merge. |
* fix(perf): correct three 07-27 perf regressions Traversal capacity cap no longer scales with worker concurrency (stablyai#11026). retainWorkspaceSpaceScanEntry charged a traversal-wide entry counter, so N workers each holding a listing multiplied the live charge. At concurrency 48 a 48x2,100 tree (100,848 entries) hit the 100,000 cap while 100x1,500 (150,100 entries, 50% more) passed, and scanLocalWorktree treats the capacity error as terminal, reporting an intact worktree as "Unavailable" with sizeBytes 0. The cap is now per directory listing -- the only quantity fixed by directory shape -- restoring the invariant docs/workspace-space-scan-resource-bounds.md already states. Aggregate live retention stays bounded by the unchanged 64 MiB byte cap. Note: releasing each entry's charge at dispatch (the originally suggested fix) was measured and does not help; the peak is set at admission, before any entry is dispatched. Repo image icons are no longer fully base64-decoded on every snapshot publish (stablyai#11012). sanitizeRepoIcon reached decodeBase64Prefix, which sized its buffer to the whole payload to read a 24-byte header, running synchronously inside ipcMain.handle at a 250 ms throttle. Validation is now memoized on source+src in a BoundedMap. Measured for 10 icons x 256 KB: 37.34 ms -> 0.67 ms per publish. One over-long card label no longer discards the entire snapshot (stablyai#11012). isDashboardSnapshot was all-or-nothing and dashboard-popout returned early with no log while replaying lastSnapshot, so `orca terminal rename --title "<1025+ chars>"` froze the pop-out board on its last good paint with nothing surfaced. Labels are truncated at the producer, the validator drops only the offending card, and both the rejection and the drop are logged. The bound now lives in the shared snapshot contract so producer and validator cannot drift. Co-authored-by: Orca <[email protected]> * fix(perf): charge a scan listing's parent path once, not per entry The 4.1 fix made the entry cap per-listing but left the 64 MiB byte cap charging parentPath.length for every entry in a listing. Because a listing's entries all share one parent-path string, that multiplied the path by the directory's width, so the byte cap measured checkout depth rather than live heap. The reported symptom therefore still reproduced at the production default limits: 48 x 2,100 @ concurrency 48 raised a capacity error once the worktree path passed ~58 characters, while the same layout at concurrency 1 succeeded. The shipped regression test could not see this because it passes maxRetainedBytes: Number.MAX_SAFE_INTEGER, disabling the only cap still in play. Measured at a real 65-char worktree root, 3 of the report's 4 documented layouts still failed. The parent path is now charged once per listing, with its first entry, so an empty listing strands no charge. Per-entry overhead is unchanged at 512 B + name, which still dominates the estimate, so the OOM protection the original PR added is preserved. Adds a production-default-limits case covering the report's layouts under a deep root, plus an assertion that a short and a deep root reach the same verdict -- the path independence docs/workspace-space-scan-resource-bounds.md requires and which no existing test enforced. Co-authored-by: Orca <[email protected]> * fix(perf): prove the icon cache by decode count, not wall clock The caching test asserted a per-publish millisecond budget, which failed on CI at 5.64 ms against a 5 ms ceiling. Any threshold flakes on a loaded box, so count real sanitizeRepoIcon entries instead: 10 repos x 20 publishes is 200 icon checks against exactly 1 decode. Added cases pin the cache key (payload and source both re-decode; a cached image verdict never answers for an emoji) and that a rejection is cached too. Also drops budget.entries, which the per-listing cap left as a traversal-wide counter no check reads -- exactly the shape a future guard could reintroduce the concurrency bug from. Co-authored-by: Orca <[email protected]> * fix(dashboard): bound the project filter label the whole board rides on stablyai#11042 added snapshot-level filterOptions whose project labels are repo.displayName -- the same unbounded source this PR already bounds for card.repoName, but one level up where dropping a card cannot recover it. An over-long project name would fail isDashboardFilterOptions and take the entire snapshot with it, which is the exact frozen-board failure the per-card drop was added to end. Workspace-status labels are already capped at 32 by workspace-statuses.ts, so only projects needed this. Co-authored-by: Orca <[email protected]> * fix(dashboard): disambiguate the repo icon cache key The memoization key joined `source` and `src` with a space, but the sanitizer's base64 pattern admits whitespace inside a valid `src`. A rejected icon can therefore split the same concatenation differently and inherit an accepted icon's cached verdict, reaching the pop-out's `<img src>` without ever being sanitized. Length-prefix the source. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
What
Three regressions landed on 07-27 and are corrected here. Rebased onto
d3681f6306; the merge with #11042 (agent status search board) and #11089 (icon republish) is described under Rebase below.Workspace scan capacity scaled with worker concurrency, not directory shape (introduced in fix(workspace-space): bound traversal memory and serialize local disk scans #11026,
src/shared/workspace-space-scan-budget.ts:69).retainWorkspaceSpaceScanEntrycharged a traversal-wide entry counter, so N concurrent workers each holding a listing multiplied the live charge. At concurrency 48 a 48 × 2,100 tree (100,848 entries) hit the 100,000 cap while 100 × 1,500 (150,100 entries, 50% more) passed.scanLocalWorktreetreats the capacity error as terminal, so an intact worktree reported as "Unavailable" withsizeBytes0. Separately the 64 MiB byte cap chargedparentPath.lengthfor every entry in a listing, even though a listing's entries share one parent-path string — so the byte cap measured checkout depth rather than live heap. Both are fixed: the entry cap is now per directory listing (the only quantity fixed by directory shape) and the shared parent path is charged once per listing.budget.entrieswas removed entirely rather than left as a traversal-wide counter no check reads.Repo image icons were fully base64-decoded on every snapshot publish (introduced in feat(dashboard): tint agent cards by state, show the project as an icon, name the chat #11012,
src/main/ipc/dashboard-payload-validation.ts:75).sanitizeRepoIconreacheddecodeBase64Prefix, which sized its buffer toMath.min(maxBytes, ceil(len/4)*3)— with an 8 MiB header limit against a 256 KiB icon cap that always resolves to the whole payload — to read a 24-byte PNG header. This ran synchronously insideipcMain.handleat the renderer's 250 ms republish cadence. The image branch is now memoized onsource + srcin aBoundedMap.One over-long card label discarded the entire snapshot, silently (introduced in feat(dashboard): tint agent cards by state, show the project as an icon, name the chat #11012,
src/main/ipc/dashboard-popout.ts:69).isDashboardSnapshotis all-or-nothing and the handler returned early with no log, so the pop-out replayedlastSnapshotforever. Labels are now truncated at the producer, the validator drops only the offending card, and both the outright rejection and the per-card drops are logged.ELI5
Three separate things were making the app misbehave after that day's changes.
First, the disk-usage scanner had a safety limit meant to stop it eating memory on absurdly large folders. That limit was being counted wrong in two ways: it was shared across all the scanner's parallel workers, and it counted the folder's path text once per file instead of once per folder. The upshot was that a perfectly normal project could get refused — and whether it got refused depended on how many workers happened to be busy and how deep in your filesystem you keep your checkouts. People saw their project listed as "Unavailable" with a size of zero. Now the limit only reacts to what it is supposed to react to: one genuinely enormous folder.
Second, the agent dashboard re-checked every project icon from scratch four times a second, unpacking the entire image each time just to peek at its first two dozen bytes. With ten projects that was around 37 milliseconds of blocking work per refresh, which showed up as stutter. The answer for a given icon is now remembered, so it costs well under a millisecond.
Third, if any single agent card had a very long name, the whole dashboard pop-out window rejected the update and just kept showing whatever it had last — no error, no explanation, frozen board. Long names are now shortened before they are sent, and if a card is still unusable only that one card is dropped while the rest of the board keeps updating. The pop-out also writes a warning when it drops something, so this cannot fail invisibly again.
Rebase — merging with #11042 and #11089
Both upstream commits touch the same files. Neither fixes any of these three findings, so no hunk was dropped as already-fixed. The merges:
#11042 (agent status search board) extended
dashboard-payload-validation.tswithMAX_DASHBOARD_SUBAGENTS,MAX_DASHBOARD_FILTER_OPTIONS,DASHBOARD_REVIEW_STATES, a'done'bucket,isDashboardFilterOptions, and snapshot-levelshowIdle/filterOptions. Their change extends what is validated; this PR changes how. Three things were checked rather than assumed:admitDashboardSnapshotfilters onisDashboardCard, which feat(dashboard): add agent status search board #11042 extended in place — soreview,subagents,workspaceStatus*,hasReviewand the'done'bucket all route through the same drop. Pinned bydrops a card that fails only the search-board fields(a badreview, a badsubagentsentry, and an unknown bucket → 3 dropped, board survives) andkeeps a done-bucket card the search board produces.showIdleandfilterOptionsdescribe the frame, not one card, so there is nothing to salvage by dropping a card —admitDashboardSnapshotnow checks both explicitly and returnsnull. Pinned bymirrors isDashboardSnapshot on every snapshot-level rejection, which asserts the two functions agree on all seven snapshot-level failure modes.RepoIconorsanitizeRepoIcon. Key remainssource + src; pinned byre-decodes when the icon payload or its source actually changes.#11089 (stop re-sending icon data URLs) rewrote the same
dashboard:publishSnapshothandler body to carry an omittedrepoIconsByRepoIdforward intolastSnapshot. Both changes are kept: the admission gate runs first, then their icon-carry-forward operates onadmitted.snapshot, and the wire payload stays as slim as the renderer sent it. Theirreplays the last repo icons when the cached snapshot omitted themtest passes unmodified.One real bug surfaced by the merge. #11042's
filterOptions.projects[].labelisrepo.displayName— the same unbounded source finding 3 bounds forcard.repoName, but snapshot-level, where a per-card drop cannot recover it. An over-long project name failsisDashboardFilterOptionsand takes the whole board with it: exactly the frozen-pop-out failure this PR exists to end. Bounded at the producer, with a test that fails without the fix. (Workspace-status labels were already capped at 32 inworkspace-statuses.ts.)Proof of fix
1. Scan capacity (no screenshot — see gaps below)
The report's own trigger table, encoded as a test, run against the parent source (
git checkout <base> -- src/shared/workspace-space-scan-budget.ts):Note the shape of the parent-commit failure: 48 × 2,100 (100,848 entries) fails while 100 × 1,500 (150,100 entries) passes. That inversion is the bug — the verdict tracked concurrency, not size.
With the fix, on the rebased tree:
The byte-cap half of this finding was found during review of the first commit and fixed in
6ecabf4aa6. The fourcapacity at the production default limitscases fail against the first commit too, not only against the parent. The cliff was located by binary search at root path length 59 (58 chars = ok, 59 = fail), i.e. an ordinary~/projects/orca/.claude/worktrees/<name>checkout sat past it.2. Icon decode — now a deterministic decode count, not a wall clock
The previous revision asserted
perPublishMs < 5, which failed on CI at 5.64 ms (job 90429445914). CodeRabbit flagged the same thing and suggested raising the ceiling to 10 ms. That was not taken: any millisecond threshold is unfalsifiable on a loaded runner and would flake again. The assertion is now a decode-count seam that spies on the realsanitizeRepoIcon:Against the un-memoized validator (
git checkout origin/main -- src/main/ipc/dashboard-payload-validation.ts, tests left in place):Three cases the timing assertion could never have caught came with the seam:
re-decodes when the icon payload or its source actually changes— pins thesource + srckey: two distinct payloads and a same-bytes/different-sourceicon give 3 decodes for 6 checks.sourceselects whichsrcpattern is legal, so it must not collide.caches a rejection too— a rejected icon is decoded once, not once per publish.does not let a cached image verdict answer for a non-image icon— emoji/lucide bypass the cache entirely (3 decodes for 3 checks), so they can never share its keyspace.does not let a split of one icon key inherit another icon verdict— added at pre-merge review. The key joinedsourceandsrcwith a space, but the sanitizer's base64 pattern ([A-Za-z0-9+/=\s]+) admits whitespace inside a validsrc, so an icon whosesourceis not a legalRepoIconImageSourcecould split the same concatenation differently and inherit an accepted icon's cachedtrue— reaching the pop-out's<img src>without ever being sanitized. The key is now length-prefixed (${source.length}:${source}${src}). Verified to fail with only that one line reverted:expected true to be false.Standalone measurements against the real exported validator, 20 runs averaged (unchanged from the previous revision; the memoization itself is unchanged):
3. Frozen pop-out board
Triggered through the documented public path —
orca terminal rename --title "<1800 chars>", which the RPC accepts unbounded — against a real agent terminal in a running instance of this worktree's build.Parent code. The main window sidebar and tab both show the new
LONGTITLELONGTITLE...name, while the pop-out (third tab, and the card in the pop-out window below) is still stuck onPerfDemo. This is the decisive frame: the rename succeeded everywhere except the pop-out.Pop-out window, parent code — frozen on the stale card:
Pop-out window, fixed — the card updates, truncated to fit:
Same window size, same route, same app state; the only variable is the fix.
Test evidence for the same finding. Parent source (
dashboard-payload-validation.ts+dashboard-popout.tsreverted):Producer half, with
build-dashboard-snapshot.tsreverted:And the snapshot-level project label found during the rebase, with only that one call unbounded:
Proof of no regression
New regression tests. Fifteen, across four files:
src/shared/workspace-space-entry-traversal.test.ts—capacity depends on directory shape, not tree size or concurrency(5 cases, incl. "still rejects a single directory above the cap") andcapacity at the production default limits(4 cases, run with no limits override under a deep root, plus an explicit short-root-vs-deep-root same-verdict assertion).src/main/ipc/dashboard-payload-validation.test.ts— five icon-cache cases on the decode-count seam (incl. the key-ambiguity case added at pre-merge review), and fiveadmitDashboardSnapshotcases (incl. the two that pin feat(dashboard): add agent status search board #11042's new fields, and theisDashboardSnapshotparity case).src/main/ipc/dashboard-popout.test.ts—keeps publishing the board when one card is invalid, and says so;logs when a snapshot is rejected outright.src/renderer/src/components/dashboard/build-dashboard-snapshot.test.ts—truncates labels to the length the snapshot validator accepts;truncates the project filter label the whole snapshot rides on.Every one was verified to fail with its source reverted and pass with the fix — real output pasted above. Reverts were done with
git checkout <ref> -- <source file>, source files only, leaving the tests in place.Full run over the touched area, on the rebased tree.
isDashboardSnapshot's all-or-nothing semantics are unchanged — its existing "bounds the conversation name" test still passes unmodified, and the new parity case assertsadmitDashboardSnapshotagrees with it on every snapshot-level rejection. The drop-one-card behavior lives in a separateadmitDashboardSnapshotexport, so no pre-existing contract was weakened.Two assertions in
workspace-space-scan-budget.test.tswere updated because their expected byte totals encoded the old per-entry parent-path charge, and one becausebudget.entriesno longer exists. That is a deliberate change to the estimate, described indocs/workspace-space-scan-resource-bounds.mdin this PR; it is not a weakened assertion.Typecheck.
pnpm run typecheck:node,typecheck:web,typecheck:cli— all exit 0, no output.Lint.
pnpm run check:code-quality:changed—0 new finding(s)across all three gates (oxlint, type-aware, React Doctor) over 11 changed files.Deliberately not changed.
WORKSPACE_SPACE_ENTRY_OVERHEAD_BYTES(512 B) andmaxRetainedBytes(64 MiB) are untouched. Per-entry overhead still dominates the estimate — at a 12-char name the cap admits roughly 125k live entries against a realDirentcost of ~150-250 B — so the OOM protection fix(workspace-space): bound traversal memory and serialize local disk scans #11026 added is preserved, and the byte cap is still traversal-wide and shared by all concurrent listings.sanitizeRepoIconitself is unchanged, so the accept/reject verdict is identical — only its repetition is avoided.card.task/lastUserMessage/lastAgentMessageare not bounded at the producer, unlikerepoName/worktreeName/conversationName, because they already are upstream and more tightly than the validator requires:prompt→normalizePromptField→ 200 (validator allows 200);lastAssistantMessage→normalizeOptionalMultilineField→ 8000 (validator allows 8000);orchestration.taskTitle→buildOrchestrationTaskDisplayMetadata→ 80. Every write intoAgentStatusEntrygoes throughnormalizeAgentStatusObject. The three that were bounded come fromrepo.displayName/worktree.displayName/ tab titles, none of which pass a normalizer.Disclosed gaps
dufallback to fail as well; fix(workspace-space): bound traversal memory and serialize local disk scans #11026's own notes place this primarily on the Windows path wherescanLocalWorktreeWithNodeis the only local scanner. ~100k files were not written on this host. The substituted evidence is the table-driven test plus the measured peak live-entry counts (48×2100 peaked at 100,849; 100×1500 at 72,100).collectWorkspaceSpaceDirectoryEntries, so 48 workers admit 48 full listings before any entry is dispatched and a dispatch-time release is too late. It was reverted; the shipped fix decouples the cap from concurrency instead. Reviewers expecting the dispatch-time change in the diff should know it was tried and rejected on measurement, not skipped.src/relay/workspace-space-scan.ts,RELAY_FS_CONCURRENCY = 48) inherits this fix through the shared budget module and its existing tests pass, but a live SSH relay host was not exercised.git stash push -- <file>commands quoted in the original implementation notes were no-ops against an already-committed tree and could not have produced the output attributed to them. The conclusions were nonetheless correct — every fail-on-parent result in this PR was independently re-produced withgit checkout <ref> -- <source>and is pasted verbatim above.Made with Orca 🐋