Skip to content

Allow naming agents from the UI (add displayName + rename API)#26

Open
NitayRabi wants to merge 1 commit into
mainfrom
codex/fix-github-issue-#23
Open

Allow naming agents from the UI (add displayName + rename API)#26
NitayRabi wants to merge 1 commit into
mainfrom
codex/fix-github-issue-#23

Conversation

@NitayRabi

Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a user-friendly, persistent display name for agents so operators can label agents in the UI without changing their internal ids.
  • Expose a small control-plane API to let authenticated browser clients set/clear an agent's display name.
  • Ensure the new field is persisted and surfaced in topology snapshots and the session-start UI.

Description

  • Added an optional displayName to the shared protocol agentSchema and propagated it through the server model and responses.
  • Persisted displayName in the DB with migration apps/server/drizzle/0001_agent_display_name.sql and wired it into apps/server/src/db/schema.ts.
  • Implemented repository support: renameAgent(agentId, displayName) and ensured listTopology() / findAgent() return displayName.
  • Added an authenticated endpoint PATCH /api/agents/:id in apps/server/src/app.ts that validates and normalizes input and broadcasts topology updates.
  • Exposed renameAgent(...) in the browser API client (apps/web/src/api.ts) and updated AgentPicker UI (apps/web/src/components/AgentPicker.tsx) to show displayName ?? name and allow inline renaming via double-click.
  • Updated tests and fixtures to cover the new behavior and added a server test renames an agent display name from browser API.

Testing

  • Ran server unit/integration tests with cd apps/server && pnpm test -- --run test/app.test.ts and observed all tests passing (21 passed).
  • Ran web tests with cd apps/web && pnpm test -- --run test/app.test.tsx and observed all tests passing (7 passed).
  • Iterative test runs were used while adjusting imports and request validation until both suites passed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant