Repository navigation
fix(control-ui): harden workspace avatar projection - #103657
Conversation
|
Land-ready proof for prepared head
pnpm test src/shared/avatar-limits.test.ts && pnpm test src/agents/identity-avatar.test.ts src/agents/identity-avatar-file.test.ts && pnpm test src/gateway/assistant-avatar.test.ts src/gateway/assistant-identity.test.ts src/gateway/control-ui.http.test.ts src/gateway/server-methods/agent.test.ts src/gateway/server-methods/usage.test.ts src/gateway/session-utils.test.ts && pnpm test src/plugin-sdk/agent-runtime-avatar-contract.test.ts && pnpm --dir ui test src/lib/agents/display.test.ts src/lib/assistant-identity.test.ts src/pages/config/quick.test.ts
env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changed -- CHANGELOG.md scripts/plugin-sdk-surface-report.mjs src/agents/identity-avatar-file.test.ts src/agents/identity-avatar-file.ts src/agents/identity-avatar-projection.ts src/agents/identity-avatar.test.ts src/agents/identity-avatar.ts src/gateway/assistant-avatar.test.ts src/gateway/assistant-avatar.ts src/gateway/assistant-identity.test.ts src/gateway/assistant-identity.ts src/gateway/control-ui.http.test.ts src/gateway/control-ui.ts src/gateway/server-http.ts src/gateway/server-methods/agent.test.ts src/gateway/server-methods/agent.ts src/gateway/server-methods/usage.test.ts src/gateway/server-methods/usage.ts src/gateway/session-utils.ts src/infra/file-descriptor-read.ts src/plugin-sdk/agent-runtime-avatar-contract.test.ts src/shared/avatar-limits.test.ts src/shared/avatar-limits.ts src/shared/avatar-policy.ts ui/src/lib/agents/display.test.ts ui/src/lib/assistant-identity.test.ts ui/src/lib/assistant-identity.ts ui/src/lib/avatar.ts ui/src/pages/config/quick.test.ts ui/src/pages/config/quick.ts
corepack pnpm exec oxfmt --check --threads=1 src/agents/identity-avatar-file.test.ts src/gateway/assistant-avatar.test.ts src/gateway/control-ui.http.test.ts
corepack pnpm test src/agents/identity-avatar-file.test.ts src/gateway/assistant-avatar.test.ts src/gateway/control-ui.http.test.ts
node scripts/report-test-temp-creations.mjs --base origin/main --head HEAD --no-merge-base --jsonThe four Testbox lease workflows were intentionally stopped after their commands exited 0; their linked Actions records therefore show cancellation at lease shutdown. Fresh Codex autoreview found no accepted/actionable findings in the runtime patch (0.94 confidence) or final test-only cleanup (0.99 confidence).
Known proof gaps: none. |
f94c0ba to
80c4766
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80c47662c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| - **Agent abort cleanup:** serialize prompt lock reacquisition with terminal cleanup so canceled embedded runs do not self-contend on session locks for up to 60 seconds. | ||
| - **Chutes OAuth deadlines:** bound token exchange, profile lookup, and refresh requests, and keep issued tokens when optional userinfo enrichment stalls. (#102026) Thanks @Alix-007. | ||
| - **Control UI workspace avatars:** inline validated agent avatar files in bootstrap and identity responses so Personal card images render without unauthenticated avatar-route requests, while preserving configured emoji precedence. (#102892, #97602) Thanks @LZY3538. |
There was a problem hiding this comment.
Remove the normal-change changelog entry
This adds a normal fix directly to CHANGELOG.md, but the root AGENTS.md Docs/Changelog rule says CHANGELOG.md is release-only and that normal PRs/direct fixes should put release-note context in the PR or commit while release generation owns the changelog. Keeping this manual entry risks stale or duplicate release notes when the generated release changelog is produced.
Useful? React with 👍 / 👎.
|
Final prepared-head addendum for
|
|
Merged via squash.
|
* fix(control-ui): harden workspace avatar projection Co-authored-by: LZY3538 <[email protected]> * refactor(gateway): remove dead avatar URL mapper * test(control-ui): track avatar temp directories --------- Co-authored-by: LZY3538 <[email protected]>
What Problem This Solves
The workspace-avatar fix merged in #102892 makes local avatars render in the Control UI, but its first implementation also widens the public agent-runtime result shape and performs file reads after a size check without keeping the read itself bounded. A file that grows after the pinned open can therefore exceed the avatar cap, and usage-only agent enumeration can pay the cost of reading and base64-encoding every configured avatar.
Related: #97602, #102892.
Why This Change Was Made
This follow-up keeps one internal owner for local avatar path resolution, the pinned descriptor, and bounded reads. Gateway bootstrap,
agent.identity.get, agent-list projection, and the authenticated avatar route share one selected-avatar projector; usage-only callers use the existing lightweight agent list. Browser projections enforce the encoded size and URI-scheme boundary without changing persisted config validation or the shipped publicAgentAvatarResolutionshape. The temporary main-only projection export and duplicate URL mapper are removed.User Impact
Workspace avatars continue to render inline without unauthenticated
/avatarretries. Missing, escaped, hardlinked, oversized, or concurrently growing files fall back safely; configured emoji and same-origin avatar-route behavior remain intact. Usage RPCs no longer read avatar files.Evidence
tbx_01kx5v8c769tprxz6v3zwvey2b(lease log 29088350746), command exit 0 with 1,492 tests across shared, agent, Gateway, plugin SDK, and UI surfacestbx_01kx5whq48n2djjja0ngzbzy10(lease log 29089516046), formatting plus 369 agent/Gateway tests exited 0; the temp-creation guard reports no annotationstbx_01kx5v8p7h3jd8rqfbxyptk49e(lease log 29088360259), command exit 0 across typecheck, lint, architecture, and contract guardstbx_01kx5v8rwdjxhv9f46yqtjmd9w(lease log 29088362745),pnpm buildexited 080c47662c894065a90ccbde2ea9d10188393f51ftbx_01kx5ze1azssayg7eje36etwka(run 29092138689); token-authenticated/openclawdocument and bootstrap returned 200 with the expected CSP/frame/nosniff/referrer headers, the full PNG data URL rendered complete at natural 1x1 dimensions, the UI connected, and 33 captured requests contained zero/avatar/retries, zero 401s, zero page errors, and zero console errorsNo agent transcript is attached.