Skip to content

fix(memory): allow desktop distillation requests - #1292

Merged
XingYu-Zhong merged 1 commit into
KunAgent:developfrom
SunwardL:codex/fix-memory-distillation-desktop
Sep 7, 2026
Merged

fix(memory): allow desktop distillation requests#1292
XingYu-Zhong merged 1 commit into
KunAgent:developfrom
SunwardL:codex/fix-memory-distillation-desktop

Conversation

@SunwardL

@SunwardL SunwardL commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Fix desktop Memory distillation IPC routes

Summary

  • Allow the desktop runtime IPC bridge to forward the Memory distillation candidate collection request and individual candidate decision request.
  • Keep the allowlist narrow: only GET /v1/memory/distillation and POST /v1/memory/distillation/:candidateId/decision are admitted.
  • Add focused regression coverage for allowed methods, rejected methods, malformed nested paths, and unchanged Memory record/diagnostics routes.
  • Record the historical interactive acceptance finding in the active Memory distillation OpenSpec change.

Why

PR #1266 added the runtime and renderer-side Memory distillation flow, but the desktop IPC request schema did not include its two endpoints. The renderer therefore could construct candidate-list and Allow/Deny/Withdraw requests, while the Electron main-process allowlist rejected them before they reached the Kun runtime.

The explicit distillation templates are registered before the generic /v1/memory/{id} matcher. This preserves the existing record mutation contract and avoids treating distillation as a Memory record ID.

Changes

  • Import and register the existing distillation collection and decision endpoint templates in src/main/ipc/app-ipc-schemas/runtime.ts.
  • Add 17 tests in src/main/ipc/app-ipc-schemas-memory-distillation.test.ts.
  • Preserve the OpenSpec distinction between the historical blocked UI run and acceptance that still needs to be repeated on the current baseline.

Tests

  • Focused Vitest: 65/65 passed
    • Memory distillation IPC: 17/17
    • Existing app IPC schema: 37/37
    • Kun runtime config service: 11/11
  • npm run typecheck
  • npm run build
  • npm run lint — 0 errors, 30 existing warnings
  • openspec validate add-kun-memory-distillation --strict
  • git diff --check

The full local test suite and packaging matrix were not rerun for this three-file patch; PR CI remains the source of truth for those broader checks.

Related: #1266

@XingYu-Zhong
XingYu-Zhong merged commit d9704e4 into KunAgent:develop Sep 7, 2026
5 of 7 checks passed
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.

2 participants