You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Enhance Input/Output Structure of "experimental.chat.system.transform" and "experimental.chat.messages.transform" Hooks for Better Usability #27364
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Version
Current version: 1.14.48
Environment
Pure code logic, environment-agnostic.
Problem Description
While developing an OpenCode plugin, I discovered the experimental.chat.system.transform and experimental.chat.messages.transform hooks.
I was excited because they seemed perfect for fine-tuning system prompts and message history for each prompt. However, I quickly realized they didn't meet my expectations due to a shared limitation: the Input and Output data structures are insufficient. See the details below:
sessionID and messageID are important pieces of data for determining whether and how we should process the system prompt and message history for the current prompt. I suggest adding them to the input structure. (Of course, due to the differences in callers, it is acceptable for these fields to be optional/undefined in certain cases.)
Improvement Suggestions
experimental.chat.system.transform
Parameters:
input: { sessionID?: string; messageID?: string; model: Model }
output: { system: string[] }
experimental.chat.messages.transform
Parameters:
input: { sessionID?: string; messageID?: string; model: Model }
Since these are experimental hooks, the impact of the change is minimal. The proposed changes are backward compatible and require very little code modification, making them highly feasible.
Use case this blocks: after writing to apps/internal/src/*.tsx, check if the new content contains Lingui macros and conditionally inject "run i18n:extract before this turn ends" into the system prompt. Without file path or new content in system.transform, the injection has to be a standing rule in session.compacting that fires on every compaction regardless — coarse-grained and delayed. Access to recent tool output (at minimum the file path and new content from the preceding write/edit) would make this targeted and immediate.
Activity
guillempuche commentedon Jun 20, 2026
Use case this blocks: after writing to
apps/internal/src/*.tsx, check if the new content contains Lingui macros and conditionally inject "run i18n:extract before this turn ends" into the system prompt. Without file path or new content insystem.transform, the injection has to be a standing rule insession.compactingthat fires on every compaction regardless — coarse-grained and delayed. Access to recent tool output (at minimum the file path and new content from the preceding write/edit) would make this targeted and immediate.Reference:
lingui-remind.shgithub-actions commentedon Aug 20, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.