Skip to content

fix(memory): accept extra digest fields - #12675

Merged
johnnyeric merged 3 commits into
Kilo-Org:mainfrom
Hardik180704:fix/12674-memory-digest-extra-fields
Jul 30, 2026
Merged

fix(memory): accept extra digest fields#12675
johnnyeric merged 3 commits into
Kilo-Org:mainfrom
Hardik180704:fix/12674-memory-digest-extra-fields

Conversation

@Hardik180704

Copy link
Copy Markdown
Contributor

Issue

Fixes #12674

Context

Memory digest generation can return valid JSON containing useful model-specific fields in addition to topic and summary. The digest schema rejected the entire response when those extra keys were present, causing a memory.error event and fallback behavior even though the required digest fields were valid.

Implementation

Allow the digest-only schema to use Zod's default unknown-key handling. Additional fields are accepted and stripped from the parsed result, while topic and summary retain their existing validation and defaults. The stricter schemas used for typed memory operations remain unchanged.

A regression test covers the reported next_step and blockers fields and verifies that only topic and summary reach downstream code.

Screenshots / Video

N/A — this is a parser behavior fix with no visual changes.

How to Test

Manual/local verification

  • Agent-executed: bun test test/capture.test.ts in packages/kilo-memory — 29 passed.
  • Agent-executed: bun test in packages/kilo-memory — 165 passed.
  • Agent-executed: bun run typecheck in packages/kilo-memory — passed.
  • Agent-executed: bun run lint at the repository root — passed with 0 errors and existing warnings only.

Reviewer test steps

  1. Parse a digest response containing valid topic and summary fields plus additional keys such as next_step and blockers.
  2. Confirm parsing succeeds.
  3. Confirm the parsed result contains only topic and summary.
  4. Confirm typed memory-operation schemas still reject unsupported fields.

Blocked checks and substitute verification

  • None.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

Please reach out through GitHub on this PR.

@kilo-code-bot

kilo-code-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/friendly-memories-rest.md
  • packages/kilo-memory/src/capture/parse.ts
  • packages/kilo-memory/test/capture.test.ts

Reviewed by claude-sonnet-5 · Input: 16 · Output: 2.5K · Cached: 289.2K

Review guidance: REVIEW.md from base branch main

@johnnyeric
johnnyeric merged commit 0d923d0 into Kilo-Org:main Jul 30, 2026
27 checks passed
@johnnyeric

Copy link
Copy Markdown
Contributor

Thanks for the fix!

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.

memory.error on auto save events

2 participants