Skip to content

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

Description

@841730577

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


Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions