Skip to content

feat(plugin): expose user message in experimental.chat.system.transform hook #27401

Description

@Flare576

The hook gets sessionID and model but not the user message. Plugins are stuck injecting static or session-level content regardless of what the user actually asked.

StreamInput.user is right there at the call site in llm.ts line 120 — it's just not being passed through. Fix is two lines: user: input.user in the trigger call, user?: UserMessage in the hook input type in packages/plugin.

I'm building a context injection plugin for Ei — personal knowledge base that injects relevant context into the system prompt before each LLM call. Without the user message I can only inject recent stuff, not what's actually relevant to what was asked. Kills the whole point.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions