feat(fresh-agent): render opencode-pty notifications as agent text (display-only) - #806
Merged
Merged
Conversation
… criteria, per-phase final gate
…se exception, drop affordance overreach, bake in cloud e2e backend
… the transcript display
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
opencode-pty plugin notification messages (the machine-injected
<pty_exited>/<pty_waited>/<pty_wait_timeout>blocks that arrive as genuine user-role turns) now render everywhere in the fresh-agent UI as agent text: agent label and bubble styling, markdown rendering, folded into adjacent agent turns as continuations, no minimap tick or hover preview, and agent-parity toolbar affordances. The minimap rail now shows only real human prompts.Display-only by construction: a single shared pure classifier (
reclassifyPtyNotificationTurnsinshared/fresh-agent-turns.ts) is composed first inside the existingdisplayTurnsmemo inFreshAgentTranscript.tsx— the same choke point that already rewrites synthetic tool-result user turns for display. The wire snapshot contract ("exactly what the model sees"), store turns, the rollback stepper's raw user-role step counts (sum-to-rollback.undoneDepthpin), andfreshAgentSnapshotHasUserTurnare all untouched; a guard test pins the stepper raw rule.Changes
shared/fresh-agent-turns.ts— additive classifier (leading-tag detection, first-text-item-then-summary extraction, identity-preserving for non-matches, never mutates input)src/components/fresh-agent/FreshAgentTranscript.tsx— one import + the memo composition (2 lines)test/unit/shared/fresh-agent-turns.test.ts— 6 classifier unit teststest/unit/client/components/fresh-agent/FreshAgentTranscript.test.tsx— 5 display pins (label/bubble, markdown path, continuation fold, toolbar parity, rollback raw-rule guard)test/e2e-browser/specs/fresh-agent-pty-notification-display.spec.ts— new cloud-legal e2e: freshopencode pane seeded with a realistic<pty_exited>conversation; asserts agent article, no You, exactly one minimap tickVerification
typecheck:clientclean;lintclean on touched filesIncludes the implementation plan (
docs/plans/2026-09-18-pty-notification-display-role.md) with the recorded user-authorized red-base exception.