Skip to content

appId JSON tag inconsistency: camelCase vs snake_case in API response #363

Description

@mashenjun

Summary

The appId field uses camelCase in JSON tags while all other API-facing fields use snake_case (agent_id, session_id, memory_type, created_at, etc.). This creates a visible inconsistency in both request and response bodies.

Current state

Direction Behavior
Request input Accepts both appId (primary) and app_id (legacy fallback) via AppIDLegacy field
Response output Always returns appId (camelCase) — no dual-serialize
Clients None of the 4 plugins or dashboard currently read appId from responses
{
  "id": "mem_xxx",
  "content": "...",
  "appId": "app-1",          // ← camelCase, inconsistent
  "agent_id": "test-agent",   // snake_case
  "session_id": "session-1",  // snake_case
  "memory_type": "insight",   // snake_case
  "created_at": "..."         // snake_case
}

Source

  • server/internal/domain/types.go:41: AppID string json:"appId,omitempty"
  • server/internal/handler/memory.go:33-34: dual AppID + AppIDLegacy in request struct
  • Introduced by Bosn in fa23053e (2026-06-04)

Suggested approach

Leave as-is for now. Input side already handles both formats. Output side change would be breaking. Address when designing v3 API with consistent naming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions