Skip to content

fix: echo author_type in remember responses + CLI --author-type flag - #1108

Merged
ajianaz merged 1 commit into
developfrom
fix/1106-author-type-echo
Aug 26, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/1106-author-type-echo

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

What (description of the change)

POST /remember and uteke remember --json stored author_type correctly (#1084) but never echoed it — clients couldn't confirm what was recorded without a follow-up GET /memory. The CLI didn't expose the field at all.

  • HTTP /remember response now includes author_type (omitted-request default mirrors the schema default agent, Add author_type (human|agent) to memory records — default agent, filterable & sync-safe #1083)
  • CLI: new --author-type flag (human|agent), validated before any write so invalid values fail loudly without leaving a stored row behind; echoed in --json on both remember paths (contradiction-detection path and plain path)
  • run_via_server path forwards the flag in the HTTP body

Why

Round-trip symmetry is the convention used by neighboring fields (id, content, tags are all echoed). Found during v0.16.0 pre-release QA (#1106).

Testing

Empirical verification in isolated stores (--store /tmp/... CLI, UTEKE_HOME=/tmp/... server):

  • explicit human → echo human + DB row human (both CLI and HTTP)
  • no flag/field → echo agent + DB row agent (schema default)
  • invalid robot → CLI: Error: Invalid --author-type: ... with zero rows written (validation moved pre-write); HTTP: 400 with validation message

cargo test --workspace → 11/11 suites green; fmt + clippy -D warnings clean.

Closes #1106

…1106)

POST /remember and uteke remember --json stored author_type correctly
but never echoed it, so clients couldn't confirm what was recorded.
The CLI didn't even expose the field (#1084 shipped HTTP-only).

- HTTP /remember response now includes author_type (default mirrors
  the schema default 'agent', #1083)
- CLI: new --author-type flag (human|agent), validated BEFORE any
  write so invalid values fail loudly without leaving a stored row;
  echoed in --json on both remember paths (contradiction + plain)
- run_via_server path forwards the flag in the HTTP body

Verified empirically in isolated stores: explicit human -> echo human
+ DB human; default -> echo agent + DB agent; invalid 'robot' -> loud
error / HTTP 400, zero rows written.

Closes #1106
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 1a081e2 into develop Aug 26, 2026
15 checks passed
@ajianaz
ajianaz deleted the fix/1106-author-type-echo branch August 26, 2026 10:06
ajianaz added a commit that referenced this pull request Sep 6, 2026