Repository navigation
fix: echo author_type in remember responses + CLI --author-type flag - #1108
Merged
Merged
Conversation
…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
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
What (description of the change)
POST /rememberanduteke remember --jsonstoredauthor_typecorrectly (#1084) but never echoed it — clients couldn't confirm what was recorded without a follow-upGET /memory. The CLI didn't expose the field at all./rememberresponse now includesauthor_type(omitted-request default mirrors the schema defaultagent, Add author_type (human|agent) to memory records — default agent, filterable & sync-safe #1083)--author-typeflag (human|agent), validated before any write so invalid values fail loudly without leaving a stored row behind; echoed in--jsonon both remember paths (contradiction-detection path and plain path)run_via_serverpath forwards the flag in the HTTP bodyWhy
Round-trip symmetry is the convention used by neighboring fields (
id,content,tagsare all echoed). Found during v0.16.0 pre-release QA (#1106).Testing
Empirical verification in isolated stores (
--store /tmp/...CLI,UTEKE_HOME=/tmp/...server):human→ echohuman+ DB rowhuman(both CLI and HTTP)agent+ DB rowagent(schema default)robot→ CLI:Error: Invalid --author-type: ...with zero rows written (validation moved pre-write); HTTP: 400 with validation messagecargo test --workspace→ 11/11 suites green; fmt + clippy-D warningsclean.Closes #1106