Commit c0e2f9b
fix(agentos-server): fall back to _id lookup in /agents/resolve
Agents registered via the UI or /agents/register have no `agentId` field
set — that field is only stamped by the telemetry projection when the SDK
runs with agent_id=. The resolve endpoint was doing a strict { agentId }
lookup, returning 404 for these agents even though the caller was passing
the valid Mongo _id.
Now falls back to an ObjectId _id lookup when the agentId field miss
occurs, so callers can use the _id returned by /agents/register directly
as their SMOKE_AGENT_ID / agent_id reference without a separate adoption
run.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent dee8752 commit c0e2f9b
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
| |||
0 commit comments