fix(tui): hide plugin-injected system reminders from transcript#32
Conversation
a738627 to
7bf6444
Compare
|
Thanks for the contribution! To get this ready to merge:
Full conventions: |
7bf6444 to
caf20d5
Compare
|
@ZouR-Ma Thanks for the review. I've rebased onto the latest main and confirmed |
|
Plugin hooks can inject system messages for the model (e.g. the subagent delegation reminder). These should not be rendered as visible SYSTEM entries in the TUI transcript because they repeat every turn and clutter the conversation. - Add optional flag to , , and . - Preserve through PluginManager, AgentLoop, ConversationMemory, and the OpenTUI bridge. - Filter hidden entries out of TUI transcript rendering and clipboard export. - Mark as hidden in subagent-plugin.
caf20d5 to
aaf3917
Compare
|
@ZouR-Ma Thanks for the review. I've added a test case to
Please take another look when you have a moment. |
PluginInjectedMessage allowed role "user" with a hidden flag that the agent loop silently ignored. Model it as a discriminated union so the flag only exists on the system variant, and document the constraint.
|
Re-review passed — this is ready to land. The new test is exactly the one we asked for: The one leftover from the review — Merging once CI reruns on that touch-up. Your #69 and #72 overlap with this PR on a couple of files — worth rebasing them once this lands. Thanks for turning the test around the same day. |
ZouR-Ma
left a comment
There was a problem hiding this comment.
The hidden-persistence test matches the acceptance criterion exactly, the type is now tightened so the hidden flag only exists on system messages, and all required checks are green on the merged state. Approving.
Closes #33
Problem
The
subagent-plugininjects aDelegation remindersystem message viabeforeModelRequeston every user turn. Because the TUI renders every system message, the reminder appears repeatedly in the conversation transcript, cluttering the UI. Plan-plugin and skill-plugin inject similar internal status messages that also leak into the transcript.Solution
Add an optional
hiddenflag to plugin-injected system messages. Hidden messages are still included in the model context (so behavior is unchanged), but they are skipped by the TUI transcript renderer and clipboard export.Changes
packages/protocol/src/index.ts: addhidden?: booleantoSystemMessage.packages/core/src/plugins/types.ts: addhidden?: booleantoPluginInjectedMessage.packages/core/src/plugins/manager.ts: preserve thehiddenflag when aggregating injected messages.packages/core/src/agent/agent-loop.ts: passhiddenfrom injected messages into memory.packages/core/src/agent/conversation-memory.ts: preservehiddenwhen cloning/restoring system messages so it survives checkpoints.src/runtime/local-opentui-bridge.ts: forwardhiddento transcript entries.src/tui/types.ts: addhidden?: booleantoStepCliTuiTranscriptEntry.src/tui/app.tsx: filter hidden entries out ofbuildTranscriptItems.src/tui/transcript-export.ts: filter hidden entries from clipboard export.skills/builtin/src/subagent-plugin.ts: markMAIN_ORCHESTRATION_REMINDERashidden: true.skills/builtin/src/plan-plugin.ts: mark plan-status injection ashidden: true.skills/builtin/src/skill-plugin.ts: mark skill-context injection ashidden: true.Verification
pnpm exec tsc --noEmitpasses.pnpm buildsucceeds.pnpm exec vitest run packages/core/src/agent/conversation-memory.test.ts packages/core/src/agent/conversation-memory-checkpoint.test.tspasses (23/23).pnpm checkpasses after chore(docs): format pr-review-decision.md with Prettier #38 (formatting fix) is applied; only pre-existing lint warnings remain.SYSTEM Delegation reminder/Plan status/Skill contextblocks.Related
docs/skills/pr-review-decision.md.