Skip to content

feat: add /compact slash command with PreCompact/PostCompact hooks#1180

Merged
lewis617 merged 1 commit into
mainfrom
worktree-wise-gentle-valley
Jun 1, 2026
Merged

feat: add /compact slash command with PreCompact/PostCompact hooks#1180
lewis617 merged 1 commit into
mainfrom
worktree-wise-gentle-valley

Conversation

@lewis617
Copy link
Copy Markdown
Collaborator

@lewis617 lewis617 commented Jun 1, 2026

  • Add PreCompact and PostCompact hook event types (HookEvent, HookJsonInput, ExtendedHookExecutionContext)
  • Add customInstructions to CompactMessagesOptions for guided summarization
  • Extract public compactConversation() method and buildPostCompactContext() helper from handleTokenUsageAndCompaction()
  • Refactor handleTokenUsageAndCompaction() to delegate to compactConversation()
  • Add /compact built-in slash command with optional custom instructions
  • Add executePreCompactHooks() and executePostCompactHooks() convenience methods to HookManager
  • Update HookManager for PreCompact/PostCompact (configApplies, validateEventConfig, handleBlockingError, getConfigurationStats)
  • Add 9 tests for compactConversation (hooks, custom instructions, circuit breaker, error handling)
  • Rename specs/014-message-compression to specs/014-message-compact
  • Update 005-hooks spec (US15/US16, FR-056–FR-062) and 014-message-compact spec (US6/US7, FR-014–FR-024)

- Add PreCompact and PostCompact hook event types (HookEvent, HookJsonInput, ExtendedHookExecutionContext)
- Add customInstructions to CompactMessagesOptions for guided summarization
- Extract public compactConversation() method and buildPostCompactContext() helper from handleTokenUsageAndCompaction()
- Refactor handleTokenUsageAndCompaction() to delegate to compactConversation()
- Add /compact built-in slash command with optional custom instructions
- Add executePreCompactHooks() and executePostCompactHooks() convenience methods to HookManager
- Update HookManager for PreCompact/PostCompact (configApplies, validateEventConfig, handleBlockingError, getConfigurationStats)
- Add 9 tests for compactConversation (hooks, custom instructions, circuit breaker, error handling)
- Rename specs/014-message-compression to specs/014-message-compact
- Update 005-hooks spec (US15/US16, FR-056–FR-062) and 014-message-compact spec (US6/US7, FR-014–FR-024)
@lewis617 lewis617 merged commit 96a1628 into main Jun 1, 2026
1 check passed
@lewis617 lewis617 deleted the worktree-wise-gentle-valley branch June 1, 2026 07:57
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