← Back to PRs

#6840: Fix assistant identity default agent for global sessions

by JorgeAlan open 2026-02-02 03:34 View on GitHub →
gateway size: XS
## Summary - Resolve assistant identity via the default agent when sessionKey is not agent-scoped (e.g. global/main) - Keeps Control UI assistant name consistent with configured default agent ## Testing - Not run (logic-only change) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the gateway’s `agent.identity.get` handler (`src/gateway/server-methods/agent.ts`) to resolve the assistant identity’s agentId via the configured default agent when the provided `sessionKey` isn’t agent-scoped (e.g., `global`/`main`). Concretely, it replaces `resolveAgentIdFromSessionKey(sessionKey)` with `resolveSessionAgentId({ sessionKey, config: cfg })`, so Control UI identity/name selection aligns with `agents.list[].default` rather than always falling back to the hardcoded `main` default. <h3>Confidence Score: 4/5</h3> - This PR is safe to merge with minimal risk. - Change is localized to identity resolution in a single handler and aligns behavior with existing `resolveSessionAgentId` logic used elsewhere. The only issue spotted is an unused import that could fail lint/CI depending on repo settings. - src/gateway/server-methods/agent.ts <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs