Repository navigation
fix(agents): clear emoji/avatar on agents.update empty or null - #120052
jackoconner45 wants to merge 3 commits into
Conversation
|
Reopening to re-fire the pull_request CI run that did not attach on open. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57c9b15586
ℹ️ 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".
| const identity = buildAgentIdentityUpdatePatch({ | ||
| name: safeName, | ||
| emoji: params.emoji, | ||
| avatar: params.avatar, |
There was a problem hiding this comment.
Wire clear tombstones through the Control UI
When the clear starts from the shipped Control UI, it still cannot reach this new server path: ui/src/pages/agents/identity-actions.ts:71-77 returns for blank emoji edits, and ui/src/lib/agents/index.ts:219-224 omits falsy emoji/avatar fields before calling agents.update. The raw gateway method now accepts ""/null, but the default operator client remains on the old no-clear behavior, so users still cannot clear these fields from the UI.
AGENTS.md reference: AGENTS.md:L147-L147
Useful? React with 👍 / 👎.
| if (value === "") { | ||
| // Explicit empty removes the stored line; duplicated labels all go. | ||
| const clearedIndexes = nextLines.reduce<number[]>((indexes, line, index) => { | ||
| if (matchesIdentityLabel(line, label)) { |
There was a problem hiding this comment.
Clear unbulleted identity labels too
For an IDENTITY.md that uses parser-accepted unbulleted fields such as Emoji: 🙂 or Avatar: avatars/a.png, an agents.update clear reports success but leaves the stale line in the file because this new clear branch only deletes lines matched by matchesIdentityLabel, which requires a leading -. Since file identity is still read as a fallback after the config tombstone, the old emoji/avatar can reappear in list or assistant identity surfaces after a supposed clear.
AGENTS.md reference: AGENTS.md:L47-L47
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed August 6, 2026, 8:30 PM ET / August 7, 2026, 00:30 UTC. ClawSweeper reviewWhat this changesThis PR changes agent updates so empty or null emoji/avatar values become identity-clear tombstones and are removed from the rewritten identity file. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 10 items remain Keep open: the gateway repair is incomplete on the default Control UI path, parser-accepted unbulleted identity fields remain stale, and the public SDK cannot type null clears. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI sends agent identity edits through the gateway, which merges agent configuration and rewrites IDENTITY.md. Agent list and assistant identity readback can use both configuration and the workspace identity file. flowchart LR
Edit[Operator identity edit] --> UI[Control UI]
UI --> Request[Gateway update request]
Request --> Schema[Protocol validation]
Schema --> Config[Agent configuration merge]
Config --> Identity[Identity file rewrite]
Identity --> Readback[Agent identity readback]
Decision needed
Why: The branch changes a public gateway input from a no-op-like omission to a persisted clear, so the compatibility contract needs explicit maintainer intent before the mechanical fixes are finalized. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +42, Tests +148. Total +190 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Choose the public empty-string contract, then land one end-to-end repair that uses a tri-state Control UI draft, aligns identity-file deletion with its parser, and exports the selected nullable contract through the SDK. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main compacts empty identity values away, and the PR still visibly leaves unbulleted parser-accepted file fields and first-party UI clears unreachable. Is this the best way to solve the issue? No. The gateway tombstone is an appropriate owner boundary, but this branch omits the first-party client and SDK contracts and disagrees with the identity file reader grammar. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ec023a433614. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Thanks @jackoconner45. The earlier, broader repair at #119930 remains open under exact-head review, and the canonical issue #119929 stays open until that repair lands. This PR covers the same agent identity-clear path. The earlier PR also carries the Control UI, SDK, identity-file, and Gateway boundaries, so no unique behavior is being dropped here. Closing this narrower PR as a duplicate. |
Closes #119929
AI-assisted contribution: drafted with the help of an AI coding agent; tests and typechecks in Evidence were run against the exact head commit.
What Problem This Solves
Fixes an issue where operators who clear an agent's emoji or avatar in the Control UI (or via the
agents.updategateway method) would see the previous value silently kept. Empty strings were compacted away bycreateAgentIdentityConfig, so the identity patch was omitted entirely and the prior emoji/avatar survived — there was no way to clear either field, unlikemodel, which already supports anullclear path.Why This Change Was Made
Explicit empty string or
nullforemoji/avatarnow acts as a clear tombstone, mirroring the existingmodel: nullsemantics:nullalongside empty string for both fields.agents.updatebuilds the identity patch through a newbuildAgentIdentityUpdatePatch, keeping an explicitemoji: ""/avatar: ""tombstone instead of compacting it away.User Impact
Operators can now clear an agent's emoji or avatar by updating with an empty value (as the Control UI already sends on clear) or with
null— consistent withmodel: null. Clearing persists to both the agent config and IDENTITY.md, so the cleared state survives reloads and reconnect identity fetches.Evidence
Focused suites pass on the exact head commit (148 tests):
src/agents/identity-file.test.ts(19) — patch-builder clear semantics and IDENTITY.md line deletionsrc/gateway/server-methods/agents-mutate.test.ts(99) —agents.updateclears emoji/avatar in config and IDENTITY.md for""andnull, preserves untouched fieldspackages/gateway-protocol/src/schema/agents-models-skills.test.ts(30) — schema accepts empty/null emoji/avatarTypechecks:
tsgo:coreclean; scoped tsgo checks of all touched prod and test files clean. Full repo lanes run on CI (this environment is below the repo's Node floor of 22.22.3).Note: issue #119929 currently has a draft PR open (#119930) awaiting a maintainer product decision; this PR lands the same fix with an end-to-end tombstone through both config and IDENTITY.md.