Skip to content

fix(agents): memory digest export lifecycle - #266

Merged
ScriptedAlchemy merged 1 commit into
masterfrom
claude/memory-digest-lifecycle
Jul 4, 2026
Merged

fix(agents): memory digest export lifecycle#266
ScriptedAlchemy merged 1 commit into
masterfrom
claude/memory-digest-lifecycle

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

The fact_store and fact_feedback memory write handlers now return raw JSON envelopes (tool_json) instead of markdown-rendered output (rendered_tool_json).

After the "Default TraceDecay tool output to markdown" change (#262), these write-path handlers rendered their status JSON ({ status, feedback, count, ... }) as markdown. That interfered with the memory digest export lifecycle, which expects the structured JSON result. A new tool_json helper emits the truncated JSON envelope (with project handle) directly. handle_memory_status intentionally keeps the rendered markdown path.

Recovery note

This was recovered from a stranded git worktree that had a stale rebase in progress. The fix branch (codex/claude-memory-digest-fixes) had been based on an older master, so its conflicting hunks in src/agents/claude.rs, src/agents/mod.rs, and tests/agent_suite/agent_test.rs were reverts of unrelated newer master work (PR #258 codex hook trust migration, PR #260 analytics/agent tests) rather than part of the memory-digest fix. Those files were confirmed to carry no memory-digest content and were discarded; only the genuine memory.rs fix is carried forward, rebuilt cleanly on current origin/master.

Verification

  • cargo check — clean (only vendored libsql warnings)
  • cargo clippy --all-targets -- -D warnings — clean for touched file
  • cargo fmt — no changes
  • cargo test --test agent_suite -- memory_digest — 15 passed
  • cargo test --test agent_suite -- claude — 57 passed
  • cargo test --test mcp_suite -- fact — 12 passed

🤖 Generated with Claude Code

Return raw JSON envelopes from the fact_store and fact_feedback memory
write handlers instead of markdown-rendered output. After the markdown
default output change, these write-path handlers rendered their status
JSON as markdown, which interfered with the memory digest export
lifecycle. A new `tool_json` helper emits the truncated JSON envelope
(with project handle) directly; `handle_memory_status` continues to use
the rendered path.

Recovered from a stranded worktree whose stale rebase base had reverted
unrelated master work (PR #258/#260 agent-surface changes); only the
genuine memory.rs fix is carried forward here, rebuilt cleanly on
current origin/master.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2576b86

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review July 4, 2026 01:06
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@ScriptedAlchemy
ScriptedAlchemy merged commit 656162c into master Jul 4, 2026
16 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the claude/memory-digest-lifecycle branch July 4, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant