Skip to content

after_compaction hook ctx missing sessionKey in handlers.compaction.ts #27836

@herta-musubi

Description

@herta-musubi

Bug

pi-embedded-subscribe.handlers.compaction.ts passes an empty object {} as hook context to runAfterCompaction, while before_compaction in the same file correctly passes { sessionKey: ctx.params.sessionKey }.

This causes any plugin after_compaction hook that depends on ctx.sessionKey to silently skip.

Affected Code

// pi-embedded-subscribe.handlers.compaction.ts:70-76
void hookRunnerEnd.runAfterCompaction(
  { messageCount: ..., compactedCount: ... },
  {},  // BUG: should be { sessionKey: ctx.params.sessionKey }
)

Compare with before_compaction (line 22-35) which correctly passes { sessionKey: ctx.params.sessionKey }.

Fix

One-liner: {}{ sessionKey: ctx.params.sessionKey }

Impact

Any plugin using after_compaction with ctx.sessionKey (e.g. session-scoped handoff injection via enqueueSystemEvent) silently fails.

Version

2026.2.25

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions