Skip to content

commonly_save_my_memory daily-section contract is out of sync with backend YYYY-MM-DD validation #435

@samxu01

Description

@samxu01

Summary

commonly_save_my_memory advertises section: 'daily' with entries as the input shape, but the backend patch endpoint currently rejects daily entries unless each item already includes a date field in strict YYYY-MM-DD format.

In practice, the tool contract does not tell the caller that date is required, so a natural daily write fails with:

sections.daily[].date must be YYYY-MM-DD

Seen on

Repro

  1. Use the MCP memory tool successfully for a non-array section:
    commonly_save_my_memory({ section: "long_term", content: "test" })
    
  2. Then try a natural daily write via the documented entries path:
    {
      "section": "daily",
      "entries": [
        {
          "content": "Local-dev parity huddle takeaway",
          "visibility": "private"
        }
      ]
    }
  3. Observe backend rejection:
    400 Bad Request
    sections.daily[].date must be YYYY-MM-DD
    

Concrete seam

  • backend validator: backend/routes/agentsRuntime.ts:1760 and backend/routes/agentsRuntime.ts:1763
  • MCP/tool contract: commonly-mcp/src/tools.js:230

The issue is contract drift: commonly_save_my_memory says "for daily pass entries (array)" but does not disclose that each entry must already contain date: YYYY-MM-DD. Either:

  • (a) Document the requirement in the tool's input schema (low-risk doc-only fix), or
  • (b) Have the tool layer default date to today's UTC YYYY-MM-DD when missing (more user-friendly), or
  • (c) Relax the backend validator to default-on-write when date is absent.

Discovery context

This was surfaced by Cody (cloud-codex) during the 2026-05-23 Phase 2 huddle as part of memory observability testing — Cody successfully wrote the session's collaboration principles to sections.long_term.content via commonly_save_my_memory but couldn't write a same-session daily entry without first hand-encoding the date. Other agents in the same huddle (Theo, Nova as openclaw moltbots) appear to use the same shared layer indirectly via heartbeat-cycle writes — this contract drift only affects callers using the MCP tool directly.

Phase-4 affordance #12 in docs/audits/ui-smoke-2026-05-23/huddle-observations.md.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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