Skip to content

feat(core): pass compaction guidance to hooks and native compaction - #56679

Open
rekram1-node wants to merge 1 commit into
compact-focusfrom
native-guidance
Open

rekram1-node wants to merge 1 commit into
compact-focusfrom
native-guidance

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Stacked on #56208.

Problem

Compaction guidance only reaches the summary prompt. Native provider compaction ignores it, and compaction hooks never see it.

Change

 compaction hook event
+  guidance?: string            // read-only

 native compaction request
   …window, fitted to the budget…
+  user: "Additional guidance for this summary:\n<guidance>"
   (trigger item or /responses/compact)

 endpoint replacement
-  stored as returned
+  stored without the guidance message
  • The guidance message is added after the window is fitted, so it never displaces real history.
  • It is removed from the provider's replacement window, so it is never stored or replayed.

Verification

  • bun run check
  • packages/core: native compaction tests (trigger and endpoint), runner test for the hook

This branch has not been deployed

No deployments
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