You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(bots): show a mascot's colour and outfit as its bot's Slack icon - #47381
When you give a bot's mascot a colour or an outfit in Orca, its Slack app still showed the plain blue mascot. Now Orca draws the mascot exactly as you see it (colour, outfit, and all, or neither) as a 512 px picture and sends that to Slack as the bot's icon. A plain mascot is drawn too, so resetting the colour shows today's mascot, not an older picture. Until a window draws a new look, Slack keeps the bot's last drawn icon; a bot that was never drawn shows the plain mascot.
Files
Added
Deleted
Net
Test
8
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1484
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1484
Prod
31
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1632
$\color{#cf222e}{\Huge{\mathbf{−}}}$67
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1565
What Changed
Before: the bot's host sent Slack only the mascot's id, so a coloured or dressed mascot showed up in Slack as the plain sky-blue mascot.
After: for a Slack- or GitHub-linked bot whose mascot has a colour or an outfit, a desktop window draws the picture once per look (the mascot's SVG on its tile colour, the face an outfit redraws, then the outfit's large art) into a 512 px PNG and hands it to the bot's host. The host keeps it in its own app data (bot-slack-icons/<hashed bot id>/<look>.png, never in the bot's home) and sends it as an uploaded picture, the same way an uploaded photo already goes. Nothing changes in the connector service.
Host side: a shared botSlackIconLook key (mascot, colour, outfit, art version) decides whether a drawing is needed and which file matches. Two new RPCs, bots.avatar.slackIcon.wanted and .upload, sit behind a new bots.slack-icon.v1 capability, so a window never calls an older host. Storing runs in the same queue as bot edits. The host refuses a drawing whose look is no longer the bot's (checked before decoding), keeps an icon another window already stored, and accepts only a whole PNG whose pixels decode (zlib runs off the main thread). A file cut short by a crash reads as missing and is drawn again. Deleting a bot deletes its icons.
Sync:BotAvatarSync now keys what it last sent by picture and look. It sends the kept drawing when its look matches. Otherwise it sends nothing if the connector service already took a drawing for this bot and account (Slack keeps that one until the new look is drawn), and the plain mascot id only when it took none. A newly stored icon queues only that bot. What it last sent is kept per signed-in account (read from memory, never from disk), so when another account signs in each picture is sent to it (before, a picture taken under the first account was skipped for the second); while signed out nothing is sent and no retry timer runs, and the next sign-in sends what changed. If the connector service doesn't take a drawing, it isn't sent again by the existing retry timer. It waits for a real step instead: a bot write, bots turned on (by the owner or the team), a new drawing, the connector service answering again after an outage, a sign-in, or a restart. Turning bots off lets the kept bytes go and drops the send queue, with no timer left running.
Renderer:drawBotSlackIcon waits for the outfit's layers and large art (a read that fails after its retries now gives up instead of hanging) and gives the SVG an explicit size so the canvas rasterises it at 512 px. useBotSlackIcons (window level) follows the bots list only once another surface has loaded it, and never loads it itself. It looks only at hosts whose list changed, and in them only at bot records that changed. It keeps one queue per host, holding at most one waiting attempt per bot, and drops an attempt as soon as it is superseded or bots are turned off.
Failures: a drawing that fails in the window is retried quietly on the next real step there: the bot's record changing, its host coming back, bots turned back on, the host's own settings changing, focusing the window, or a reload. An upload the host fails to send is retried on the host's next real step (below). Nothing runs on a timer, and nothing new is shown in the UI.
Known limit: failed uploads wait for a real step (accepted). If the host's upload of a stored icon fails (a timeout, a server error, signed out), it is sent again on the host's next real step: a bot edit, bots turned on (by the owner or the team), a newly stored drawing, a completed sign-in (also to the same account; a routine refresh of the sign-in is not one) or a switch of account, the connector's poll being answered again after its own outage (which always resends), or a restart. A failure that got no answer, a server error or a rate limit is also resent once on the poll's next answer; if that try fails too, it waits for one of the other steps, after which a new failure gets its one resend again. While the account must sign in again, any picture (a drawing, a photo or a plain mascot) waits for that sign-in rather than a timer. Only the connector's own poll counts as the service answering: its other traffic never resends a picture. An upload the connector service refused outright (it doesn't know the bot yet) waits for a bot edit, a newly stored drawing, bots turned on, a completed sign-in or account switch, or a restart, not for the poll being answered again. The host's note of which drawing the connector service took is saved for restarts, in the background (an upload never waits on the disk). A save that fails is tried again once on the poll's next answer, then on each of the real steps above, and once more when Orca quits or relaunches, or a host's background service stops (waiting at most 2 seconds, so a stuck disk never holds any of them up). The note is written whole or not at all, so a crash mid-write keeps the previous one. If the disk stays unwritable through quit, or Orca crashes before a save lands, the note is lost, and after the restart the connector service is sent the plain mascot until the look is drawn. If a different account is signed in when an upload's answer arrives, no note is kept for it; signing out or quitting meanwhile keeps the note for the account the upload went out as. Quitting or relaunching waits, within the same 2 seconds, for uploads already on their way to answer, so their notes are saved too. If a quit is cancelled after it started (a window asks to confirm and the user stays), pictures that would have gone out while quitting wait for the next bot edit, sign-in or restart; cancelling a quit also leaves the connector's poll stopped until then, as before this PR. If a save hangs on a disk that never answers and the bot is deleted meanwhile, its icon folder (its drawings and this note) is removed only once that save finishes, and is left behind if Orca exits first; removing it sooner would let the hung save bring it back. Focusing or reloading a window does not resend an already stored icon. It is never resent on a timer, so an outage costs no background wakeups or repeated image uploads; until that step, Slack keeps the picture it had. If Slack itself refuses or rate-limits the icon after the connector service has taken it, that is up to the connector service; this PR doesn't change it. Orca shows nothing in either case.
Known limit: no window open. A colour or outfit set while no desktop window is open (from a phone, the CLI, or a host with no window attached) leaves Slack on the bot's previous drawn icon (the previous colour and outfit) until a desktop window next opens and draws the new look. A bot never drawn, or whose host restarted before the new look was drawn, shows the connector service's plain mascot meanwhile.
Known limit: lasting failures stay silent. If Slack will never take the icon (the bot's Slack grant has expired, or a workspace admin has locked app profile edits), Orca shows nothing and keeps the plain mascot or the last picture Slack accepted. No new UI text covers this.
Corners: the drawn PNG is fully opaque. Its tile colour fills the whole square, so Slack's rounded crop shows the tile colour at the corners on light and dark themes, never a white fill.
Why
Slack needs an image, and only a renderer can draw the mascot's SVG and outfit bitmaps (main has no SVG rasteriser). Drawing in the window, once per look, and keeping the result on the host keyed by that look gives the right picture without a new native dependency. It also keeps the connector service unchanged and never sends a wrong look: a look set from a phone or the CLI, or while no window is open, leaves Slack on the last drawing until a window draws it. Falling back to the plain mascot on each edit was tried and rejected: the service's stored mascot is older art, and Slack's limit of about one icon change a minute could keep it showing for minutes. Retries are tied to real steps, not timers, so an outage never repeats work in the background.
Linked Issue
No issue: reported directly by a maintainer.
Visual Proof
Slack icon before / in-app avatar / exact 512 px PNG sent now (light and dark)
Rendered with the component fixture bots/BotSlackIcon at 2x, so the right-hand image shows the PNG at its real 512 px.
Coloured mascot (dark tile, light rim):
Coloured mascot with the party outfit:
Coloured mascot with the reviewer outfit (redraws the face):
Corners: the exact sent PNG for three looks on a white and a dark Slack background, cropped round at 72 and 36 px and shown uncropped. All four corner pixels are fully opaque (alpha 255), so Slack's crop shows the tile colour, never a white fill:
Testing
src/main/connector-cloud/bot-avatar-sync.test.ts: real look key and real icon file store in a temp folder. A coloured mascot is sent plain, then as the drawn PNG once it is kept, then plain again when the outfit changes (the old look's file is never reused). Edits that cross uploads in flight (dark with outfit, outfit off, default colour, white) end with the latest look's drawing sent last, and never the mascot id; this fails without the plain-look fix. A truncated file, one without image data, and one whose data won't decompress all read as missing. Both fail without this change.
src/main/connector-cloud/bot-avatar-sync.test.ts also drives a failing connector with a stored drawing, both unavailable and refusing an unknown bot. Ten minutes, then two hours of the retry timer send nothing more, and the next bot write sends it.
src/renderer/src/components/bots/use-bot-slack-icons.test.ts: a failed upload schedules no timer and isn't tried again for the same bot record, even after ten minutes, and a real step (a saved look) sends it.
Checked that real Chrome canvas PNGs (opaque and with alpha) pass the host's PNG check.
Rendered the exact PNG the window uploads with pnpm fixtures:shot bots/BotSlackIcon --theme both --scale 2 (above) and compared it with the in-app large avatar.
pnpm check:changed passes. Tested on macOS; no platform-specific code.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
No new timers, polls or idle wakeups, and the existing connector retry timer never resends a drawn icon. The window-level hook reads the bots list only after another surface has loaded it. A notice compares each host's list once and walks only hosts whose list changed, and in them only bot records it hasn't seen (a WeakSet check). Each new look of a linked, coloured or dressed mascot costs one host check. If the host wants a picture, the window does one 512 px canvas draw and one upload of about 100–300 KB, one per host at a time, with at most one waiting attempt per bot. On the host, a look key is plain regex checks per bot per avatar pass. A kept icon is validated once per file change, and zlib decompression runs on Node's thread pool. Per-bot state is dropped when a bot is deleted, its host unpaired, or bots turned off.
Perf waiver: with two Orca clients open on the same host, both can draw and upload the same missing icon once per look change. The host keeps one copy and the connector service is sent it once. The cost is one extra 512 px draw and a few hundred KB per extra open client, only on a look change, with zero idle work, and it stays the same at ten times the fleet. A per-host drawing lease would need a timer, and a content hash wouldn't stop the draw, so this is accepted as is.
Risk
Riskiest part: the sync change. If it went wrong, a bot's Slack icon could stay on an earlier picture, or one extra send could go out. It never sends a drawing for a look the bot no longer has, because the file name carries the look and the host checks it. Older paired hosts don't advertise bots.slack-icon.v1, so windows never call them. Older windows simply don't draw, and the host falls back to the mascot id. The outfit art is baked for a 384 px tile, so it is drawn about 1.33x up at 512 px; Slack shows icons far smaller than that. Revert is a plain revert; leftover files under the app data's bot-slack-icons/ folder are harmless.
Level: Low
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Security: icons live in app-owned storage under a hash of the bot id, and the host accepts a drawing only for the exact look key it computes itself (so no path from the client). It checks the drawing is a square 512–2000 px PNG of at most 2 MB, with valid chunk checksums and pixels that decode within the size its header states. Remote/SSH: paired windows draw for remote hosts through the same RPCs. Mobile: phones don't draw; the host falls back to the mascot until a desktop window does.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
The change adds look-specific Slack icons for linked bots. The renderer creates PNGs from mascot and outfit art, then publishes them through host RPC. The main process validates and stores uploaded icons. Cloud avatar sync sends a stored icon when its look matches the bot’s current look, and otherwise uses the plain mascot. Icon storage is removed when a bot is forgotten.
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(bots): show a mascot's colour and outfit as its bot's Slack icon" matches the main change. The changeset adds a renderer-drawn PNG of the coloured or dressed mascot, stores it on the h…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the repository template closely. It has all required sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, and Checklist. The Visual Proof …
Full details: Title check
Explanation
The title "feat(bots): show a mascot's colour and outfit as its bot's Slack icon" matches the main change. The changeset adds a renderer-drawn PNG of the coloured or dressed mascot, stores it on the host, and uploads it to Slack as the bot's icon. The title is specific and concise, and it uses the conventional commit prefix.
Full details: Description check
Explanation
The description follows the repository template closely. It has all required sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, and Checklist. The Visual Proof section includes before/after images and a fixture-based comparison. The Testing section lists the tests added and manual macOS testing. The Performance section explains the new work and includes a stated waiver. The Risk section gives a level and a revert path. Gaps: the Linked Issue section says 'No issue: reported directly by a maintainer,' which does not meet the template's requirement of a linked issue for outside contributors. The 'Fixes #' line is also left blank. The AI Disclosure section is empty. The Review section is empty. The Notes section repeats the template text without a clear result for each item. The Risk level 'Low' is weakly supported given the size and complexity of the sync change. The description is very long, and the Known limits and Failures sections are hard to follow. This makes the PR harder to review, though it does not make the description off-topic or largely incomplete.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Retry a failed icon upload without waiting for an unrelated bot… · use-bot-slack-icons.ts:73-74
src/renderer/src/components/bots/use-bot-slack-icons.ts:73-74 Minor · Functional Correctness · Quick win
Retry a failed icon upload without waiting for an unrelated bot change.
A failed draw or upload marks the bot for retry, but nothing in this file starts that retry. The next pass runs only when a bot-catalog notice arrives. The inspected catalog modules have no timer, so a bot can keep the plain mascot icon until some unrelated change occurs. Require a retry pass that does not depend on a later bot-catalog notice. The fix choice, such as the timing or a backoff, is left to the author.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: d65b29c7-7dba-48a4-8a89-7c68850a8d89
Commits
Reviewing files that changed from the base of the PR and between cdf7a70 and c3b8db5.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
…ied once on a poll answer, at real steps and at quit, and never after the bot is deleted
An upload no longer waits on the disk. A failed save is tried once on the next poll answer (later answers touch none), on each real step, and once at quit, relaunch and orcad stop, bounded to 2 s. A deleted bot's files go only after a save already on its way lands. A record is kept only if the account didn't switch during the upload.
Reviewed 18673a8c62c08c2ff7a7d3d3b8474a4a9e1aa4ca → d5b8be9ed915d9b7777f3bf4f2f162ebd8d72553 using the requested perf-scan and referenced perf guidance. Findings: none. The maintainer’s two-client drawing waiver was preserved.
This is source evidence only. No files were edited and no tests, typechecks, builds, installs, or benchmarks were run.
For fleet pricing, B is bots per host, H is listed hosts, W is renderer windows, D is resendable upload debt, and U is unsaved shown records. I traced B=100 and B=1,000 separately from the fleet’s 750/7,500 worktrees, terminal, agent, history, and ref populations. Those other populations do not enter these new loops.
The work inventory is:
New or changed work
Trigger, population, owner
Work and bound
Renderer catalog processing
Mount, enabling bots, or catalog notice; one owner/window
Unchanged flattened list: one identity check, zero host enumeration. Otherwise H host comparisons, with bot traversal confined to changed host lists. Changed records alone request icons. Host removal uses linear pruning.
Drawing admission and RPC
New look, completed picture save, host return, or retry step
One active attempt/host/window; one latest pending attempt/bot. Capability, link, host state, look, and failure gates precede RPC/drawing. Existing icon: wanted RPC only. Missing icon: wanted RPC, one draw, one upload RPC.
Rasterization
Host requests a missing icon
Fixed 512×512 canvas, at most two decoded image layers, one PNG encoding and base64 conversion. No animation or frame loop. Cost is per required drawing, never per terminal/status update.
Outfit loading
First required outfit read, or explicit recovery step after failure
Two shared files/outfit, with concurrent reads deduplicated. Nine outfits bound production caches and reset callbacks to 18 file owners. All outfit JSON totals 4,088,405 source bytes, independent of B; largest layer/large pair is 748,326 bytes. One-off failures schedule no retry timer.
Host wanted check
One admitted renderer attempt
Indexed bot lookup, then one stat. Unchanged path/size/mtime avoids PNG rereading and validation. Cold checks may read and validate one icon.
Host icon storage
One admitted upload
Base64 input capped at approximately 2.8 MB; decoded PNG capped at 2 MiB and 2000×2000. Validation precedes serialized storage; stale looks are rejected before validation and checked again before writing. Duplicate drawings produce no stored event or cloud resend.
PNG validation
Cold wanted check, storage, or actual send
CRC/chunk scanning and copying are bounded by 2 MiB input. Inflate runs through async zlib; output capped at 16,002,000 bytes, normally 1,049,088 bytes for the generated 512px RGBA image. No subprocess or synchronous filesystem call is added.
One host-owned pass over B records and bounded per-bot registries. Look derivation is cached by immutable bot record. Unchanged sent pictures do no image I/O. At B=100/1,000, these are 100/1,000 roster visits per pass, not per poll answer.
Stored-icon resend
One newly stored icon
Targets that bot through the cached lookup. At most one index rebuild per roster identity; no whole-roster picture reads.
Connector upload
Unsent picture/look/account, or admitted debt retry
Four sends/host, one send/bot. Queue contains one latest bot record/id. PNG hash, base64, and transport serialization occur only for an actual send. Encoded drawing bytes are released when that send settles.
Poll-answer recovery
Successful /poll only
Visits D answerable debt, never the full owed set. Each failure gets one answered-poll retry between real steps; another failure becomes spent. Refused drawings are excluded. With spent/empty debt: zero bot lookups, image reads, or sends.
Account tracking
Account switch or completed sign-in
Account checks use connector memory. A pass hashes the account once; individual sends make a constant number of checks. Switch plus its immediately following sign-in hook emits one recovery step. An upload crossing an account switch targets only its bot for another send.
Shown-record reads and marks
Missing drawing, or upload confirmation
Cached per bot, including absence. mark() never awaits disk. Equal settled records return without scheduling a write. Production records contain only account hash and mascot, approximately 44 JSON bytes.
Shown-record persistence
Changed mark, eligible poll answer, real step, final save
One writer; latest record and one due entry/bot. Failed saves receive one poll-answer retry, then zero further answer-driven visits until a real step. A real step visits U unsaved records. Slow writes coalesce pending marks instead of accumulating writer chains.
Bot removal clears owned state and waits for an already-running shown save before deleting files. Renderer cleanup removes listeners and pending state. Shutdown fences new sends, tracks existing confirmations, and shares one 2,000 ms deadline across final-save callers.
UI capability and contracts
Picture-button render/host status; RPC dispatch
One additional narrow capability selector/button; local host installs no entry listener. Shared schemas, capability registration, generated catalog entries, fixture, and test files add no production polling or runtime test work.
One constant boolean selector evaluation per existing store notification. Effect changes only when enabled changes; no timer.
Catalog change listener
One/enabled window; explicitly removed
Zero callbacks without catalog changes. At R notices/s: R identity checks/window; unchanged count-only notices enumerate zero hosts.
Host-return listener
One/enabled window; explicitly removed
Zero at stable idle. One callback/host-return event; examines only that host’s bots.
Window focus listener
One/enabled window; explicitly removed
Zero during steady idle. One callback/focus event, visiting failed icons only.
BOTS_CHANGED_EVENT listener
One/enabled window; explicitly removed
One callback/existing notice. Constant host/failure lookup; retries only that host’s failures for settings/unscoped notices.
Picture-button host capability selector
One/remote mounted button; removed on unmount
Local: zero entry subscriptions. Remote: one callback per relevant host-entry publication/button, with a boolean result; no new status transport.
Icon-store onStored
One/avatar-sync host; removed by host stop
Zero at idle; one synchronous publication/newly written icon to one consumer. Duplicates publish zero.
Store settings listener
One/connector host; removed by host stop
One cheap key check/settings publication. Full avatar pass only when botsEnabled is present.
Team feature listener
One additional listener/connector host; removed by host stop
Constant flag comparison on existing capability invalidations; avatar work only on a blocked/unblocked transition.
Connector onBack
One/connector host; removed by host stop
One callback/successful poll, recovery, or completed sign-in. Healthy spent-debt answers perform no roster or disk work. Events/hello/outbox calls do not publish recovery.
Existing bot-write listener, expanded callback
One/host, runtime lifetime
Existing one callback/bot write; now includes shown-record stepping and look-aware reconciliation. Not a status/PTY listener.
New completed-sign-in lifecycle hook
One/account service, desktop or orcad
Zero at idle or routine auth refresh; one/sign-in, coalesced with the same account-switch signal.
New settings notice
Existing batched bot-notice publisher and its existing clients
Zero at idle; bots-enabled changes publish through existing notice coalescing. No additional broadcast per uploaded PNG.
Outfit one-shot waiters
Shared file owner; cleared on success/failure
No idle callbacks. Resolve once/read attempt; existing picture listeners are notified once when art arrives.
Additional steady-idle wakeups: renderer 0/s, main 0/s, daemon 0/s. The new connector callback runs inside an existing poll completion. For orientation, the existing 50-second long poll yields roughly 0.02 completions/s; the default wake-channel safety poll is approximately one per 150–210 seconds. Under load, callback rate follows actual poll answers; it does not multiply by B. These are configured/source rates, not measurements.
The existing legacy avatar retry remains one host timer at most every 60 seconds, including full roster inspection. That is approximately 1.67/16.67 roster visits/s at B=100/1,000 while armed. This predates the span. Drawn-icon debt is skipped by those timer passes; the PR does not add a drawing retry timer. Existing profile access inside actual cloud calls also remains; the new account comparisons introduce no additional profile reads.
All six scan questions were assessed:
Question
Disposition and evidence
1. Work before skip gates?
Reviewed. List identity precedes host enumeration; wanted checks precede drawing; unchanged stat avoids decode; account/fence admission precedes image reads; equal shown marks avoid writes.
2. Ownership multiplication?
Reviewed. One background owner/window, one sync/store/connector owner/host, four cloud sends/host, one renderer attempt/host. No per-worktree or per-terminal installation. Two-client duplication remains waived.
3. Thread and storage costs?
Reviewed. Renderer raster/base64 and main CRC/hash/base64 are explicit bounded work. Filesystem and durable writes are async; inflate uses zlib’s pool. Per-bot sidecars avoid profile-wide persistence.
4. Growth and retry progress?
Reviewed. Pending state replaces by bot; answerable/spent sets stop repeated healthy-poll scans. Newer looks supersede older work. Ordinary disk footprint is one current icon plus shown record/bot; old-look cleanup runs after writes.
5. Execution-host differences?
Reviewed by source. Calls route to the bot’s host; capability gates exclude older hosts. No new shell, Git, SSH, WSL, or platform discovery probes. Filesystem paths use existing host-local adapters.
6. Obsolete work and release?
Reviewed. Renderer generation checks stop later stages; subscriptions and pending state clear on cleanup; deleted bots are pruned; sends release drawing bytes; fencing prevents queued image reads; final-save callers share the deadline. Active I/O is allowed to settle rather than claimed to be canceled.
Touched regression classes have these dispositions:
Class
Disposition
No-op identity writes / unchanged publication
Disproved: no new store slice identity churn; equal shown marks and duplicate icon stores suppress work/publication.
Broad keyed-map/settings selection
Disproved: enabled boolean and host-specific capability selector; no whole-map UI selection added.
Disproved: publication has one background owner/window; picture rows do not draw or upload icons.
Fixed polling / new idle wakeups
Disproved: drawing and shown-save retries are event-driven; legacy timer identified above.
Newly reachable expensive work / hidden owners
Checked: background work produces the external icon, gated by linked mascot, capability, current look, and wanted response. No hidden continuous capture or encoding.
Sync filesystem/SQLite on main
No new matching call: durable-write integration uses the async implementation; no SQLite work added.
Unchanged-input rereads
Disproved for notice/reconnect paths by identity, stat fingerprint, missing-icon cache, shown cache, and sent-picture/account cache. Actual admitted retries deliberately reread the icon.
Whole snapshot or N-notice publication
Disproved: icon storage publishes one bot id to one consumer; it does not republish the catalog.
Whole-file rewrite per change
Checked: one small per-bot record, equality suppression, one looping writer, latest-record coalescing. No growing document rewrite.
Entity state outliving entity
Checked: host/bot pruning, store forget, bounded active attempts, and listener cleanup.
Hot-path rescans
Checked: lookup indexes reuse immutable snapshots; host removal uses a set; healthy poll answers do not scan the roster or spent debt.
Unbounded fanout/queues
Disproved: four host sends, one renderer attempt/host, one latest pending entry/bot, one writer. Aggregate renderer active attempts are bounded by H, not B×H or event count.
Eager startup imports
Checked: no new SDK, network startup barrier, or eager outfit JSON contents. Existing mascot/art modules are reused; drawing waits for an already-loaded catalog and wanted response.
I inspected the contracts without executing them. They assert: bounded shown-save retries and writer ownership; zero spent-record walks; zero new account-profile reads through the sync seam; zero queued icon reads after fencing; linear host removal; and zero host-list reads on unchanged count-only notices. The ordinary tests cover recovery, sign-in/account races, latest-look ordering, deletion, and shared shutdown deadlines.
No unresolved structural amplification candidate remains. Runtime frame time, CPU, heap/GPU behavior, slow-disk latency, and Windows/Linux execution were not measured; this verdict establishes source bounds, not measured performance thresholds.
Review status: #47381 (bot Slack icon shows the mascot as drawn)
Problem. A bot's Slack app icon showed its mascot's old art, not its colour or outfit as the user sees it in Orca.
User-facing change. A desktop window draws the bot's mascot (colour and outfit, or neither) as a 512 px PNG. The bot's host stores it and uploads it to the connector service, which sets the Slack icon. When the host has no drawing for the bot's current look, it leaves Slack on the drawing the service last took instead of falling back to the plain mascot. The host keeps a small note of that drawing so this also holds across restarts. Nothing new is shown in the UI.
Head:d5b8be9ed915d9b7777f3bf4f2f162ebd8d72553. CI green (56 passed, 12 skipped).
Final-head verdicts
Claude (opus-5-5): READY. One P3, documented in the PR body at the reviewer's suggestion: a quit the user cancels leaves pictures that would have gone out while quitting for the next real step, and the connector's poll also stays stopped after a cancel, as before this PR.
Codex: READY, no findings.
Full perf scan on this head: clean (report above).
Regression audit: SAFE ("AGREE: WITHIN ACCEPTED LIMIT; SAFE") from the auditor that raised the earlier must-fixes, re-checked on this head merged onto main.
Decisions and accepted limits
Retries never run on a timer (Brennan's decision). Brennan accepted the retry limit only if comparable Slack integrations do the same. They set the icon once and never retry it. So a drawing the service failed to take is retried only on a real step (bot edit, bots turned on, a new drawing, a completed sign-in or account switch, the poll answering again after its own outage, a restart), plus once on the poll's next answer. A three-reviewer council kept those poll-based steps.
Persistence design (second council, majority P). The host's note is saved by one background writer that never makes an upload wait. A failed save is retried once on the next poll answer (later answers touch nothing), on each real step, and once at quit, relaunch and the host's background-service stop. That last save is shared by all callers and bounded to 2 seconds. Deleting a bot waits for a save already on its way. The note is written atomically.
Two-client drawing waiver (Brennan). Two windows may each draw and upload the same missing icon once per look change.
Stated limits. A disk that stays unwritable through quit, or a crash before a save lands, loses the note: the next restart sends the plain mascot until the look is drawn. A colour or outfit set with no desktop window open waits for a window to draw it. While the account must sign in again, any picture waits for that sign-in.
Confirm auditor findings. "A second failed upload waits for a real step" and "a refusal racing the bot's registration waits for a real step" were confirmed WITHIN ACCEPTED LIMIT by a fresh confirm auditor and agreed by the raising auditor.
Fixed during review (each with a test or perf contract that fails without it)
Saving the note: latest value wins; no lost wake-ups; no promise chains; no per-poll scans; one bounded retry per real step; atomic write; a deleted bot's folder never comes back; the quit save tries unsaved notes at once and again after in-flight uploads answer.
Accounts: the account is read from the connector's memory (no profile read per send). What was last sent is kept per account, so another account that signs in gets each picture. A send that lands after another account signed in is resent to it. A sign-in that finishes during a sign-out is taken up. Nothing is sent, and no timer runs, while signed out or quitting.
Window: removing a host is linear; notices that changed no bot list cost one check; a host's settings change retries every failed drawing for it; a newly stored drawing retries a failed note save.
Previously unfixed on main and fixed here: what was last sent ignored the account, so after an account switch the new account's connector never got unchanged pictures.
Verified
Unit tests and perf contracts on the real records class, the real sync, the real icon store in a temp folder, a real connector instance, and the real window hook.
Real-app QA on this head (isolated test copy on Brennan's Mac, test bot only):
Switching the mascot sent the plain id, then the drawing, and saved the note.
With the note file locked, the drawing still uploaded and the save failed.
After unlocking, quit saved the new note. Quit took 0.58 s, with no temp files left behind.
After relaunch, a colour change sent no plain mascot (held back by the saved note), then the new drawing.
The bot was restored to white.
Shutdown order checked with harnesses on the real code: the host's background service runs fence, then host stop, then the bounded save, within its 15 s deadline. Desktop quit settles the save inside the 20 s teardown deadline.
Open, outside this PR
The live Slack icon. Slack still showed the old light-blue icon after the host's white upload was accepted (204). That is in the connector service's apply path and is tracked separately with its owner. This PR does not change it.
Source-only verdict: clean for 75d83211844a01c780a57dfcab5fede1d658c2dd..66fc4eb58d8e0817fff52641e2dd551c5e6b2a5c.
I inspected all 39 changed files and the relevant producers, consumers, storage adapters, and lifecycle callers. No files were edited; no tests, typechecks, builds, installs, or benchmarks were run. The maintainer’s two-client duplicate-draw allowance was preserved without re-grading.
For pricing, B is the host’s bot population, H its client’s listed hosts, F failed icons, U unsaved shown records, and R renderer clients. I used B=100 and B=1,000 for reference/10× pricing. These populations do not multiply by the fleet’s worktrees, terminals, transcripts, or refs.
The changed-work census is:
Work and trigger
Owner / population
Work and bound
Renderer enable or initial catalog availability
One service per app renderer
Visits H hosts and their B bots once. It consumes an already-loaded catalog and initiates no roster load.
Catalog publication
Renderer service
An unchanged readBots() identity returns before reading host IDs. A changed flattened list checks H host identities; only changed host lists walk their bots. Metadata-only rebuilt lists therefore cost H comparisons, with no bot walk when host arrays survive.
Changed bot record, explicit picture save, or host return
Renderer, affected bot/host
Requests whether the host needs the look. An existing valid icon avoids drawing/uploading. Save completion additionally searches that host’s list once.
Missing drawable look
Renderer
One running attempt per host, one latest pending attempt per bot. Each attempt makes one wanted RPC and, when needed, one drawing and upload. Pending state is O(B), rather than edit-history length.
Outfit art load
Renderer, nine shipped outfits
Shared in-flight reads and retained results: at most 18 files, totaling 4,088,405 source bytes at this head. Successful files are fetched/parsed once per renderer. Icon-only failures start no retry timer.
Wanted RPC
Bot’s desktop/daemon host
Indexed bot lookup, one stat; unchanged path/size/mtime avoids re-reading and decoding. A cold/changed valid file is read and validated once before entering the fingerprint cache.
Upload RPC and storage
Bot’s host
Rejects disabled/stale looks before pixel validation, rechecks inside the existing write queue, writes only a missing valid look, and cleans older icon files within that bot’s directory. Only an actual write publishes onStored(botId).
Existing roster pass is O(B); new look derivation is weakly cached by bot object. One account hash per pass, with no new profile read for cache identity. Sends remain capped at four per host, with one queued record per bot.
Stored icon
Same host sync owner
Indexed lookup and resend of that bot only; it does not reread every bot’s picture. Unsaved shown records also receive a real-step retry.
Successful /poll answer
Connector host
Visits only answerable upload debt and answerable failed saves. Once spent, later healthy answers visit zero bot records, regardless of B, F, or U. No roster pass runs on an ordinary answer.
Poll outage ending
Connector host
Visits owed debt; refused drawings remain excluded. Each eligible debt gets another attempt through the four-send limit.
Connector send
Host main/daemon
Reads only the selected picture, validates the PNG, hashes/encodes it, and issues one PUT. Missing drawings are cached by look/icon generation; drawing bytes are released after the send.
Shown-record mark/save
Icon-store owner
Memory mark returns without waiting for disk. One writer saves the latest record per due bot. Equal saved records return early. Failed saves get one answer retry, then wait for a real step or shutdown.
Quit, relaunch, or daemon stop
Host lifecycle
Final save starts pending persistence immediately and also joins sends already underway. All callers share one two-second deadline. This bounds waiting; it does not cancel disk I/O already underway.
Bot deletion / host removal / renderer disable
Corresponding owner
Deletes keyed state and pending attempts. Bot-folder deletion waits for that bot’s active shown-record save. Renderer cleanup removes subscriptions and clears retained lists/debt.
Schemas, capability, fixture and test changes
Initialization/development
Two bounded RPC schemas and one capability string; no new polling. Fixture drawing and its delay are fixture-only.
PNG work is bounded by the existing 2 MiB compressed / 2000×2000 acceptance limit. Inflation is asynchronous through zlib’s pool, capped at 16,002,000 output bytes; the normal 512×512 drawing needs 1,049,088 RGBA scanline bytes. CRC traversal, hashing, base64 conversion and request serialization execute on the host’s JS thread, but only for admitted picture operations. There is no newly added synchronous filesystem or SQLite operation.
The listener/publication census is:
Subscription or publication
Ownership and cleanup
Idle rate and load behavior
useBotsEnabled()
One scalar store subscription per renderer
Runs its selector on existing store writes; unchanged boolean causes no effect restart or icon work.
Catalog changes
One listener per enabled renderer; removed on cleanup
Zero without catalog publications. Count-only publications use one list-identity check; changed lists follow the H/affected-host bounds above.
Host came back
One listener per enabled renderer; removed on cleanup
Zero idle; one callback per reconnect/stream recovery, visiting that host’s bots.
Window focus
One listener per enabled renderer; removed on cleanup
Zero idle; each focus visits only F failed attempts.
BOTS_CHANGED_EVENT
One listener per enabled renderer; removed on cleanup
One cheap host/debt lookup per received notice. Only settings/unscoped notices retry that host’s failures. Existing host notices coalesce at 500 ms under sustained traffic.
Picture-button capability
One host-entry subscription per mounted remote button; local subscription is a no-op
Uses existing host-status publications. Checks a capability boolean; no picture I/O or other-host fanout.
Outfit one-shot waiters
Two file waiters per active dressed drawing; cleared when the fetch settles
Zero idle. Shared loads settle current waiters once. At most 18 retained failure-reset callbacks, bounded by shipped art files. Existing presentation listeners alone can request the bounded art retry timers.
slackIcons.onStored
One listener per connector-host installation; stopped with host
Zero idle. One bot-ID publication per newly written icon; duplicates already kept publish nothing.
Store settings
One added listener per connector host; stopped with host
Existing settings notifications invoke it; non-botsEnabled updates return immediately. Equality-filtered botsEnabled changes run one pass and request one settings notice.
Team-feature changes
One added flag listener per host; stopped with host
Existing capability invalidations perform a boolean comparison. Ordinary policy refresh cadence remains unchanged: governed accounts 1/900 s, discovery 1/3600 s after initial refresh. Unchanged policy runs no avatar pass.
ConnectorReach.onBack
One avatar listener per configured host; stopped with host
One callback per successful poll answer. Typical idle long-poll cadence is approximately 1/50 s; wake-channel safety cadence is configured and jittered, ordinarily minutes. Under load the rate is the existing successful-poll rate p, not bot/agent update rate. Spent debt adds O(1) work per answer.
Sign-in/account-switch publication
One lifecycle hook in desktop and daemon
Zero idle. One effective signedIn event per completed sign-in; synchronous switch-plus-sign-in hooks are deduplicated. Refreshing the same account does not publish a sign-in.
Settings notice publication
Existing host notice owner and client routes
Added only for actual bot-enable changes. Carries scope metadata, never PNG bytes. Existing client roster refresh coalescing remains in force.
The existing onBotsWritten → avatars.changed() subscription is retained, rather than added per bot. Its O(B) roster pass and the legacy 60-second retry mechanism predate this span. At B=100/1,000, a legacy timer pass visits 100/1,000 records per minute—about 1.67/16.67 record visits per second averaged—while unchanged successful pictures cause no image read or send. Drawn-icon debt is now excluded from that timer.
New independent steady-idle wakeups: renderer 0/s, Electron main 0/s, daemon 0/s. The poll listener executes inside an existing poll completion; it adds no timer, IPC frame, or network poll. The final-save timer exists only on shutdown/relaunch. Signed-out or fenced sends return before picture reads and do not arm retries.
The six scan questions are disposed as follows:
Question
Disposition
1. Work before skip gates?
Reviewed. Catalog identity, host-list identity, record keys, capability, current-look, saved-picture and file-fingerprint gates precede the corresponding expensive work.
2. Ownership multiplication?
Reviewed. One renderer service, one sync per host, shared outfit files, four host sends, and one shown-record writer. The explicitly waived two-client drawing case is unchanged.
3. Thread/storage costs?
Reviewed. Renderer owns rasterization; host JS owns bounded validation/encoding preparation; inflation and filesystem operations are asynchronous. Shown persistence writes individual small records, not the profile or roster.
4. Growth/progress?
Reviewed. Queues hold latest bot state, healthy polls consume only answerable sets, failed retry eligibility is spent, and real steps restore progress. No queue or history grows per poll answer.
5. Execution host?
Reviewed across desktop, Electron serve and orcad routing. Image storage occurs on the bot’s host. No new shell, Git, SSH-per-file, or platform discovery calls. Durable replacement uses the existing asynchronous Windows retry path: at most six rename attempts and 750 ms backoff.
6. Obsolete work/lifetime?
Reviewed. Pending work is pruned; renderer continuation checks suppress stale downstream drawing/upload admission. Already-started work can finish; new queued host image reads stop at the quit fence. Shutdown waiting shares the two-second budget.
The touched regression classes were screened individually:
Regression class
Disposition
No-op identity churn
Disproved: icon acceptance publishes only on written; no new renderer store map writes.
Broad keyed-map/settings selection
No matching broad selection: added settings subscription selects the existing enable boolean; capability subscription is host-specific.
Per-row whole-collection derivation
Disproved: service is app-owned; picture buttons add only a capability check.
Fixed-cadence retries
Disproved for new drawing/debt/save work; legacy avatar timer remains pre-existing.
New steady-idle wakeups
Disproved: zero independent added wakeups in all three process roles.
Expensive work newly reachable past a gate
Reviewed: newly reachable rasterization is admitted only for a missing linked mascot look; disabled, unsupported, signed-out and fenced gates are retained.
Hidden/unobserved work
Required connector synchronization remains active independently of UI visibility; there is no hidden animation, continuous rasterization, or presentation poll.
Per-instance loading
Disproved: no icon service per row, pane or workspace; outfit file loads are shared.
Sync filesystem/SQLite on main
No matching newly reachable operation; durable save uses asynchronous APIs.
Disproved: shown revision is internal bookkeeping; no notification or profile version is published. Equal saved records skip marks.
Whole snapshot / notice fanout
Disproved for icon publication: one bot ID per stored icon. Enable changes use existing scoped settings notices and refresh coalescing.
Whole-file rewrite
Proportionate: one small shown.json per changed bot, latest-state deduplication, one writer; no roster/profile rewrite.
Per-entity retention
Reviewed: bot deletion and renderer host removal clear keyed state; active operations retain only their bounded in-flight work.
Hot-path rescans
Disproved: unchanged notices return before host enumeration; host removal is linear, with a set membership check.
Unbounded fanout/queues
Disproved: four connector sends, one renderer attempt per host, one latest pending entry per bot, one persistence writer.
Eager startup imports
Reviewed: no new SDK or startup inventory. Mascot/art modules already occur in the eager avatar/sidebar graph; outfit JSON remains URL-loaded on demand.
Startup-migration surface: no migration, new startup await, or eager disk inventory was introduced. Store construction creates empty registries and a lazy lookup index; existing startup synchronization performs necessary per-bot output work.
Version-bump surface: the shown-record revision is one scalar used to prevent an older save clearing newer debt. It neither accumulates records nor invalidates consumers. The art-version key causes one required redraw per linked mascot when artwork changes, rather than periodic redraws.
I inspected—but did not execute—the performance contracts for spent-answer visits, failed-save retry counts, writer deduplication, host removal, count-only notices, account profile reads, and reads after fencing. Their assertions support the traced bounds. Runtime frame time, CPU, filesystem latency and heap behavior were not measured; no timing claim is made.
Review status: #47381 (bot Slack icon shows the mascot as drawn)
Problem. A bot's Slack app icon showed its mascot's old art, not its colour or outfit as the user sees it in Orca.
User-facing change. A desktop window draws the bot's mascot (colour and outfit, or neither) as a 512 px PNG. The bot's host stores it and uploads it to the connector service, which sets the Slack icon. When the host has no drawing for the bot's current look, it leaves Slack on the drawing the service last took instead of falling back to the plain mascot. The host keeps a small note of that drawing so this also holds across restarts. Nothing new is shown in the UI.
Head:66fc4eb58d8e0817fff52641e2dd551c5e6b2a5c: the reviewed head d5b8be9ed915d9b7777f3bf4f2f162ebd8d72553 (CI green: 56 passed, 12 skipped) merged with current main. The merge resolved conflicts with main's picture-picker and avatar-param refactors. It moved the icon store's construction into botSlackIconsOf() and the Slack icon params into bot-avatar-params.ts to stay under max-lines, and gave main's new avatar-revision test its icon folder. The full perf scan was re-run on the merge head: clean across hot-path, publish, subscribe, startup-migration and version-bump.
Final-head verdicts
Claude (opus-5-5): READY. One P3, documented in the PR body at the reviewer's suggestion: a quit the user cancels leaves pictures that would have gone out while quitting for the next real step, and the connector's poll also stays stopped after a cancel, as before this PR.
Codex: READY, no findings.
Full perf scan: clean on the reviewed head and again on the merge head (reports above).
Regression audit: SAFE ("AGREE: WITHIN ACCEPTED LIMIT; SAFE") from the auditor that raised the earlier must-fixes, re-checked on this head merged onto main.
Decisions and accepted limits
Retries never run on a timer (Brennan's decision). Brennan accepted the retry limit only if comparable Slack integrations do the same. They set the icon once and never retry it. So a drawing the service failed to take is retried only on a real step (bot edit, bots turned on, a new drawing, a completed sign-in or account switch, the poll answering again after its own outage, a restart), plus once on the poll's next answer. A three-reviewer council kept those poll-based steps.
Persistence design (second council, majority P). The host's note is saved by one background writer that never makes an upload wait. A failed save is retried once on the next poll answer (later answers touch nothing), on each real step, and once at quit, relaunch and the host's background-service stop. That last save is shared by all callers and bounded to 2 seconds. Deleting a bot waits for a save already on its way. The note is written atomically.
Two-client drawing waiver (Brennan). Two windows may each draw and upload the same missing icon once per look change.
Stated limits. A disk that stays unwritable through quit, or a crash before a save lands, loses the note: the next restart sends the plain mascot until the look is drawn. A colour or outfit set with no desktop window open waits for a window to draw it. While the account must sign in again, any picture waits for that sign-in.
Confirm auditor findings. "A second failed upload waits for a real step" and "a refusal racing the bot's registration waits for a real step" were confirmed WITHIN ACCEPTED LIMIT by a fresh confirm auditor and agreed by the raising auditor.
Fixed during review (each with a test or perf contract that fails without it)
Saving the note: latest value wins; no lost wake-ups; no promise chains; no per-poll scans; one bounded retry per real step; atomic write; a deleted bot's folder never comes back; the quit save tries unsaved notes at once and again after in-flight uploads answer.
Accounts: the account is read from the connector's memory (no profile read per send). What was last sent is kept per account, so another account that signs in gets each picture. A send that lands after another account signed in is resent to it. A sign-in that finishes during a sign-out is taken up. Nothing is sent, and no timer runs, while signed out or quitting.
Window: removing a host is linear; notices that changed no bot list cost one check; a host's settings change retries every failed drawing for it; a newly stored drawing retries a failed note save.
Previously unfixed on main and fixed here: what was last sent ignored the account, so after an account switch the new account's connector never got unchanged pictures.
Verified
Unit tests and perf contracts on the real records class, the real sync, the real icon store in a temp folder, a real connector instance, and the real window hook.
Real-app QA on this head (isolated test copy on Brennan's Mac, test bot only):
Switching the mascot sent the plain id, then the drawing, and saved the note.
With the note file locked, the drawing still uploaded and the save failed.
After unlocking, quit saved the new note. Quit took 0.58 s, with no temp files left behind.
After relaunch, a colour change sent no plain mascot (held back by the saved note), then the new drawing.
The bot was restored to white.
Shutdown order checked with harnesses on the real code: the host's background service runs fence, then host stop, then the bounded save, within its 15 s deadline. Desktop quit settles the save inside the 20 s teardown deadline.
Open, outside this PR
The live Slack icon. Slack still showed the old light-blue icon after the host's white upload was accepted (204). That is in the connector service's apply path and is tracked separately with its owner. This PR does not change it.
#47381 left it at 306 counted lines, failing Lint on every PR.
Co-authored-by: m4air <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When you give a bot's mascot a colour or an outfit in Orca, its Slack app still showed the plain blue mascot. Now Orca draws the mascot exactly as you see it (colour, outfit, and all, or neither) as a 512 px picture and sends that to Slack as the bot's icon. A plain mascot is drawn too, so resetting the colour shows today's mascot, not an older picture. Until a window draws a new look, Slack keeps the bot's last drawn icon; a bot that was never drawn shows the plain mascot.
What Changed
bot-slack-icons/<hashed bot id>/<look>.png, never in the bot's home) and sends it as an uploaded picture, the same way an uploaded photo already goes. Nothing changes in the connector service.botSlackIconLookkey (mascot, colour, outfit, art version) decides whether a drawing is needed and which file matches. Two new RPCs,bots.avatar.slackIcon.wantedand.upload, sit behind a newbots.slack-icon.v1capability, so a window never calls an older host. Storing runs in the same queue as bot edits. The host refuses a drawing whose look is no longer the bot's (checked before decoding), keeps an icon another window already stored, and accepts only a whole PNG whose pixels decode (zlib runs off the main thread). A file cut short by a crash reads as missing and is drawn again. Deleting a bot deletes its icons.BotAvatarSyncnow keys what it last sent by picture and look. It sends the kept drawing when its look matches. Otherwise it sends nothing if the connector service already took a drawing for this bot and account (Slack keeps that one until the new look is drawn), and the plain mascot id only when it took none. A newly stored icon queues only that bot. What it last sent is kept per signed-in account (read from memory, never from disk), so when another account signs in each picture is sent to it (before, a picture taken under the first account was skipped for the second); while signed out nothing is sent and no retry timer runs, and the next sign-in sends what changed. If the connector service doesn't take a drawing, it isn't sent again by the existing retry timer. It waits for a real step instead: a bot write, bots turned on (by the owner or the team), a new drawing, the connector service answering again after an outage, a sign-in, or a restart. Turning bots off lets the kept bytes go and drops the send queue, with no timer left running.drawBotSlackIconwaits for the outfit's layers and large art (a read that fails after its retries now gives up instead of hanging) and gives the SVG an explicit size so the canvas rasterises it at 512 px.useBotSlackIcons(window level) follows the bots list only once another surface has loaded it, and never loads it itself. It looks only at hosts whose list changed, and in them only at bot records that changed. It keeps one queue per host, holding at most one waiting attempt per bot, and drops an attempt as soon as it is superseded or bots are turned off.Why
Slack needs an image, and only a renderer can draw the mascot's SVG and outfit bitmaps (main has no SVG rasteriser). Drawing in the window, once per look, and keeping the result on the host keyed by that look gives the right picture without a new native dependency. It also keeps the connector service unchanged and never sends a wrong look: a look set from a phone or the CLI, or while no window is open, leaves Slack on the last drawing until a window draws it. Falling back to the plain mascot on each edit was tried and rejected: the service's stored mascot is older art, and Slack's limit of about one icon change a minute could keep it showing for minutes. Retries are tied to real steps, not timers, so an outage never repeats work in the background.
Linked Issue
No issue: reported directly by a maintainer.
Visual Proof
Slack icon before / in-app avatar / exact 512 px PNG sent now (light and dark)
Rendered with the component fixture
bots/BotSlackIconat 2x, so the right-hand image shows the PNG at its real 512 px.Coloured mascot (dark tile, light rim):
Coloured mascot with the party outfit:
Coloured mascot with the reviewer outfit (redraws the face):
Corners: the exact sent PNG for three looks on a white and a dark Slack background, cropped round at 72 and 36 px and shown uncropped. All four corner pixels are fully opaque (alpha 255), so Slack's crop shows the tile colour, never a white fill:
Testing
src/main/connector-cloud/bot-avatar-sync.test.ts: real look key and real icon file store in a temp folder. A coloured mascot is sent plain, then as the drawn PNG once it is kept, then plain again when the outfit changes (the old look's file is never reused). Edits that cross uploads in flight (dark with outfit, outfit off, default colour, white) end with the latest look's drawing sent last, and never the mascot id; this fails without the plain-look fix. A truncated file, one without image data, and one whose data won't decompress all read as missing. Both fail without this change.src/main/connector-cloud/bot-avatar-sync.test.tsalso drives a failing connector with a stored drawing, both unavailable and refusing an unknown bot. Ten minutes, then two hours of the retry timer send nothing more, and the next bot write sends it.src/renderer/src/components/bots/use-bot-slack-icons.test.ts: a failed upload schedules no timer and isn't tried again for the same bot record, even after ten minutes, and a real step (a saved look) sends it.Checked that real Chrome canvas PNGs (opaque and with alpha) pass the host's PNG check.
Rendered the exact PNG the window uploads with
pnpm fixtures:shot bots/BotSlackIcon --theme both --scale 2(above) and compared it with the in-app large avatar.pnpm check:changedpasses. Tested on macOS; no platform-specific code.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
No new timers, polls or idle wakeups, and the existing connector retry timer never resends a drawn icon. The window-level hook reads the bots list only after another surface has loaded it. A notice compares each host's list once and walks only hosts whose list changed, and in them only bot records it hasn't seen (a
WeakSetcheck). Each new look of a linked, coloured or dressed mascot costs one host check. If the host wants a picture, the window does one 512 px canvas draw and one upload of about 100–300 KB, one per host at a time, with at most one waiting attempt per bot. On the host, a look key is plain regex checks per bot per avatar pass. A kept icon is validated once per file change, and zlib decompression runs on Node's thread pool. Per-bot state is dropped when a bot is deleted, its host unpaired, or bots turned off.Perf waiver: with two Orca clients open on the same host, both can draw and upload the same missing icon once per look change. The host keeps one copy and the connector service is sent it once. The cost is one extra 512 px draw and a few hundred KB per extra open client, only on a look change, with zero idle work, and it stays the same at ten times the fleet. A per-host drawing lease would need a timer, and a content hash wouldn't stop the draw, so this is accepted as is.
Risk
Riskiest part: the sync change. If it went wrong, a bot's Slack icon could stay on an earlier picture, or one extra send could go out. It never sends a drawing for a look the bot no longer has, because the file name carries the look and the host checks it. Older paired hosts don't advertise
bots.slack-icon.v1, so windows never call them. Older windows simply don't draw, and the host falls back to the mascot id. The outfit art is baked for a 384 px tile, so it is drawn about 1.33x up at 512 px; Slack shows icons far smaller than that. Revert is a plain revert; leftover files under the app data'sbot-slack-icons/folder are harmless.Level: Low
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Security: icons live in app-owned storage under a hash of the bot id, and the host accepts a drawing only for the exact look key it computes itself (so no path from the client). It checks the drawing is a square 512–2000 px PNG of at most 2 MB, with valid chunk checksums and pixels that decode within the size its header states. Remote/SSH: paired windows draw for remote hosts through the same RPCs. Mobile: phones don't draw; the host falls back to the mascot until a desktop window does.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)