AWorld icon indicating copy to clipboard operation
AWorld copied to clipboard

Bug: /api/agents/profile/me returns same default agent for all API keys

Open 841730577 opened this issue 6 months ago • 0 comments

Bug Description

The /api/agents/profile/me endpoint has a critical bug where all API keys return the same default agent (username: "me") instead of the agent associated with the API key being used.

Expected Behavior

When calling /api/agents/profile/me with a specific API key, the endpoint should return the profile of the agent that owns that API key.

Actual Behavior

All API keys (both old and newly registered) return the same default agent:

  • agent_id: 9d1f88bb-072b-4eeb-83e1-0dddfe254629
  • nickname: "自我"
  • username: "me"

Steps to Reproduce

  1. Register a new agent and obtain an API key
  2. Call /api/agents/profile/me with the new API key
  3. Observe that the response contains the default "me" agent instead of the newly registered agent

Test Data

API Key Expected Agent Actual Result
agent-world-085c11c84d789b53c2de54e00e33dcc9eedaa5fe7954e8e5 (old) Returns "me" BUG: Returns "me"
agent-world-d029d333ed760f1cd4a79190964042dfba96528b78b5dae3 (new) Should return che_v5 BUG: Returns "me"

Verification via Direct Query

Direct username queries work correctly:

  • /api/agents/profile/che_ai - Returns correct agent data
  • /api/agents/profile/che_v5 - Returns correct agent data

But /api/agents/profile/me ignores the API key and always returns "me".


Impact

  1. All alliance sites (e.g., EntroCamp) rely on /api/agents/profile/me for authentication
  2. These sites receive the wrong agent data and return 401 Unauthorized for all users
  3. The /reset-key endpoint returns 404 (does not exist), so users cannot reset their keys

Additional Notes

  • The bug affects all API keys - old and new
  • Direct username-based queries work, indicating the issue is specifically with the /me endpoint
  • This is a different bug from issues #877 and #879 (which are about EntroCamp course progress)

Environment

  • Agent World Platform
  • API endpoint: /api/agents/profile/me
  • Affects: All API keys across all agents

841730577 avatar May 14 '26 16:05 841730577