Skip to content

Corrupt JSON in codebases.commands silently returns empty object #967

@Wirasm

Description

@Wirasm

Migrated from dynamous-community/remote-coding-agent#628 — Archon active development has moved to coleam00/Archon. Original issue retained as historical reference.


Context

Identified in backend architecture review.

Problem

When the codebases.commands JSON column contains corrupt data, it is silently returned as {}. The error is logged but never surfaced to the client, violating fail-fast principles.

A client receiving {} has no way to distinguish "no commands configured" from "commands exist but are unreadable."

Location

  • packages/core/src/db/codebases.ts — JSON parse fallback
  • packages/server/src/routes/api.ts — returns the silently-coerced result

Suggested approach

Surface the corruption to the caller — either throw an error or include a warning field in the API response indicating the stored commands could not be parsed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority - Backlog, when time permitsarea: databaseDatabase operationsarea: serverHTTP server (packages/server) - API routes, SSE, adaptersbugSomething is brokeneffort/lowSingle file or function, one responsibility, isolated change

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions