Repository navigation
Description
Context
While a goal is running, the operator can steer the coding agent from the Steering console on the goal detail page (/goals/:goalId). There are three ways to do this today:
- The free-text Correction or follow-up textarea (
sendGoalInput(goal.id, { message })). - The canned Quick actions buttons — What's done? / What's left? (
sendGoalInput(goal.id, { canned })). - Attachments sent alongside either of the above.
All of these are persisted durably in the goal_inputs table (packages/core/src/db/migrations/20260902010000_harden_native_goals.js) and are delivered to the provider either live (Codex / Claude native goal control plane) or at the next provider turn boundary (whole-session providers such as Antigravity).
The problem: the agent receives and acts on those messages, but the operator has no evidence of that in the UI. The Goal output panel in propr-ui/src/pages/GoalsPage.tsx is built entirely from useTaskLiveData(goal.taskId), which projects the provider's own stdout stream (ConversationEvent[]). ProPR-side control-plane messages never appear in that stream, so the timeline reads as if the agent spontaneously changed direction. Users cannot answer "did my correction land, and when?".
This issue adds user messages to the same timeline, in chronological order, in both the Human readable view (ThinkingLog) and the Raw terminal view (ExecutionEventLog).
Requirements
- Backend projection.
serializeGoalmust expose the goal's user-originated inputs so the detail page can render them. Only operator-authored messages are included:- Include
kind = 'input'rows (free-text corrections and canned status requests). - Exclude
kind = 'context'(ProPR's own delivery-policy message),kind = 'resume'(the syntheticGOAL_CONTINUE_INPUTnudge) andkind = 'control'(pause/cancel/model bookkeeping rows with an emptymessage).
- Include
- No internal path leakage.
addGoalInputstores the message afterappendGoalAttachmentshas appended a block containing absolutestoredPathvalues under/tmp/git-processor/goal-attachments/.... The projection must strip that appended block and instead report a boundedattachmentCount. - Bounded payload. Cap the projected list (newest 200 rows) and truncate each message body (4,000 characters, with a
truncatedflag). The goal list endpoint must not pay for this — only single-goal responses carryinputs. - Delivery state is visible. Each projected input carries
state(pending/delivered/undeliverable),createdAtanddeliveredAt, so the UI can distinguish "queued for the next provider boundary" from "already delivered". - Chronological merge in the UI. User messages are interleaved with provider events by time, using
deliveredAt ?? createdAt. Still-pending messages always render at the end of the timeline (they have not reached the provider yet) with a Queued badge. - Both views. The merged timeline is used for the Human readable view (
ThinkingLog) and the Raw terminal view (ExecutionEventLog), so switching views never loses the user's own messages. - Visually distinct. User messages must be immediately distinguishable from agent output — a distinct gutter label (
YOU), a distinct icon, and a distinct accent colour. - No regressions for tasks. The shared
TaskDetailscomponents are also used by the task detail page, which never producesuser_inputevents. All new branches must be additive and fall through harmlessly.
Implementation Specification
Backend
packages/api/services/goalAttachmentService.ts- Export the constant used by
appendGoalAttachmentsto introduce its appended block (extract it if it is currently inline), e.g.GOAL_ATTACHMENT_SECTION_HEADING. - Add and export
stripGoalAttachmentSection(message: string): { message: string; attachmentCount: number }.
- Export the constant used by
packages/api/services/goalProjection.ts- Add
GoalInputProjectionandloadGoalInputs(). - Add an options parameter to
serializeGoal({ includeInputs?: boolean }, defaulttrue) and includeinputsin the returned projection.redactVisualPreviewValuealready runs over the whole projection, so preview paths stay redacted.
- Add
packages/api/routes/goalRoutes.ts- Pass
{ includeInputs: false }from thelisthandler only. Every single-goal handler (get,pause,resume,cancel,requestModel,input) keeps the default so the detail page never loses messages after a control action.
- Pass
Frontend
propr-ui/src/api/goals.ts— add theGoalInputtype andinputs: GoalInput[]onGoal.propr-ui/src/components/TaskDetails/types.ts— widenLiveEvent['type']with'user_input'and add the optionalinputState/attachmentCount/truncatedfields.propr-ui/src/components/Goals/goalTimeline.ts(new) — pure merge helpermergeGoalTimeline(events, inputs, options).propr-ui/src/components/TaskDetails/ExecutionEventUtils.ts— handleuser_inputingetCategoryDisplayandextractEventSummary.propr-ui/src/components/TaskDetails/ExecutionEventHelpers.tsx— handleuser_inputinEventIcon.propr-ui/src/components/TaskDetails/ExecutionEventLog.tsx— render expanded user-message content.propr-ui/src/components/TaskDetails/ThinkingLog.tsx— render a distinct user-message row.propr-ui/src/pages/GoalsPage.tsx— mergegoal.inputsinto both views.
Tests
propr-ui/src/components/Goals/goalTimeline.test.ts(new) — ordering, pending-at-end, unparsable timestamps.packages/api/test/goalProjection.test.ts— projection filters kinds, strips attachment paths, bounds size, andincludeInputs: falseomits the field.propr-ui/src/pages/GoalsPage.test.tsx— the detail view renders a delivered correction inside the implementation log and a pending correction with a Queued badge.
Acceptance Criteria
- Sending a correction from the Steering console makes that exact text appear in the Human readable goal output within one poll cycle (≤ 5s), labelled
YOU. - The same message appears in the Raw terminal view when the user toggles to it.
- A message that has not yet been delivered renders at the end of the timeline with a Queued badge; once
delivered_atis set it is re-ordered into its chronological position. - Canned What's done? / What's left? messages appear in the timeline.
- ProPR's own
context,resumeandcontrolrows never appear in the timeline. - No
/tmp/git-processor/goal-attachments/...path is visible anywhere in the timeline; a message sent with two files shows an attachment count of 2 instead. -
GET /api/goals(list) response contains noinputsfield;GET /api/goals/:iddoes. - The task detail page (
/tasks/:taskId) is unchanged — nouser_inputevents exist there and no rendering branch is taken. -
npm --workspace propr-ui test -- src/pages/GoalsPage.test.tsx src/components/Goals/goalTimeline.test.tspasses. -
node scripts/run-test-suite.mjs packages/api/test/goalProjection.test.tspasses.
Created by ProPR AI Planner
Activity
propr-dev commentedon Sep 22, 2026
Suggested Implementation:
Implementation Approach
User corrective messages already exist as durable rows in
goal_inputs; they are not part of the provider's stdout stream. That is the key architectural fact driving this design.Why project from the database rather than inject into the live stream. The obvious alternative is to write a synthetic envelope into the Redis live-output stream (
agent:output:<taskId>) whenever a control message is delivered, so it flows through the existing parsers. That was rejected for three reasons: (1) it would corrupt a stream whose contract is "verbatim provider output", which several parsers (detectStoredOutputFormat,parseAgentStreamOutput, the Codex/OpenCode/Antigravity adapters) sniff by shape; (2) the stream is rebuilt on every poll, so a message queued but not yet delivered would have nowhere to live; and (3) the durable rows already carry richer state (pending/delivered/undeliverable,created_at,delivered_at) that the UI needs in order to answer "did my correction land?". Projecting from the database keeps the provider stream pure and makes the feature correct across worker restarts and whole-session resumes.Why merge in the UI rather than server-side. The provider stream is parsed and paginated by
useTaskLiveData; merging server-side would require the API to own event ordering for a stream it does not otherwise materialize. Merging client-side keeps the change to one small pure function that both views share, and keeps the merge testable without Redis.Timestamp-drift trade-off.
parseAgentStreamOutputsynthesizes monotonic timestamps for providers whose envelopes carry none (executionStartTimestamp + index * 1000). Over a long goal those synthetic stamps can drift from wall clock, so a merged user message may land slightly off its true position. This is accepted because it is bounded and cosmetic; pending messages are pinned to the end of the list so the one case where correctness matters ("has this been delivered yet?") is never ambiguous.Why widen
LiveEventinstead of introducing a parallel list. A second render path would double the styling, collapse/expand and gutter logic in two components. Widening the union keeps exactly one timeline renderer; every new branch is additive and falls through for task pages, which never emituser_input.File:
packages/api/services/goalAttachmentService.tsWhy this file:
addGoalInputpersists the message afterappendGoalAttachmentshas appended a block containing absolutestoredPathvalues. Since the projection added below returns those messages to the browser, the stripping helper must live next to the appender so both sides share one definition of the block's boundary and can never drift.Extract the heading that
appendGoalAttachmentsalready emits into an exported constant, then add the inverse operation:Then update
appendGoalAttachmentsto build its block fromGOAL_ATTACHMENT_SECTION_HEADINGinstead of an inline literal, so the two stay coupled.File:
packages/api/services/goalProjection.tsWhy this file: this is the single boundary where a
goalsrow becomes the JSON the goal detail page consumes. Addinginputshere means every handler that already returns a serialized goal (get,pause,resume,cancel,requestModel,input) automatically carries the messages, so a control action cannot momentarily blank the timeline. It is also already wrapped inredactVisualPreviewValue, so the new field inherits preview-path redaction for free.File:
packages/api/routes/goalRoutes.tsWhy this file: the list endpoint serializes up to 200 goals per request. Running one extra
goal_inputsquery per goal there would add 200 round trips for data the list view never renders, so the list is the one place that opts out.Leave every other
serializeGoal(...)call in this file untouched — they are all single-goal responses consumed by the detail page and must keep the defaultincludeInputs: true.File:
propr-ui/src/api/goals.tsWhy this file: this is the typed contract the goal detail page reads. Adding
GoalInputhere is what letsGoalsPageand the merge helper stay type-safe withoutany.File:
propr-ui/src/components/TaskDetails/types.tsWhy this file:
LiveEventis the shared shape rendered by bothThinkingLogandExecutionEventLog. Widening the union here is what allows one renderer to handle both agent output and user messages, instead of duplicating the timeline in a second component.Locate the
LiveEventinterface and widen itstypeunion plus add the user-message fields:File:
propr-ui/src/components/Goals/goalTimeline.ts(new file)Why this file: a single pure function owns the ordering rule, so the readable view and the terminal view can never diverge, and the rule is unit-testable without Redis, sockets or a rendered page.
File:
propr-ui/src/components/TaskDetails/ExecutionEventUtils.tsWhy this file: it centralizes the gutter label, colour and one-line summary for every event category. Adding the branches here means the terminal view gets correct labelling without touching its render tree.
Add a
user_inputbranch togetCategoryDisplay(before its existingthoughthandling) and toextractEventSummary:File:
propr-ui/src/components/TaskDetails/ExecutionEventHelpers.tsxWhy this file: it owns
EventIcon, the left-gutter glyph. Without a branch here a user message would silently reuse the agent-thought icon and become visually indistinguishable — defeating the purpose of the feature.File:
propr-ui/src/components/TaskDetails/ExecutionEventLog.tsxWhy this file: the raw terminal view must be able to expand a long correction. Rendering the body as pre-formatted text (not Markdown) is deliberate — this is the operator's literal input and the terminal view's contract is verbatim output.
Also extend
computeSummaryMessageso the collapsed footer can describe a trailing user message:@@ if (event.type === 'thought' && event.content) { const truncated = event.content.slice(0, 150).replace(/\n/g, ' '); return `Thinking: ${truncated}${event.content.length > 150 ? '...' : ''}`; } + if (event.type === 'user_input' && event.content) { + // The collapsed bar is the only visible row when the log is closed; showing + // the operator's last message there confirms the send without expanding. + const truncated = event.content.slice(0, 150).replace(/\n/g, ' '); + return `You: ${truncated}${event.content.length > 150 ? '...' : ''}`; + } + return '';File:
propr-ui/src/components/TaskDetails/ThinkingLog.tsxWhy this file: this is the default (Human readable) view, so it is where most operators will look for confirmation that their correction landed.
detectThoughtTypemust be bypassed for user messages — running keyword heuristics over operator text would mislabel a correction containing the word "search" as agent search activity.Also relax the interface so merged entries type-check:
@@ interface ThinkingLogEvent extends LiveEvent { relativeTime?: string | null; }(no change needed if
LiveEventwas widened as specified above — verify it compiles).File:
propr-ui/src/pages/GoalsPage.tsxWhy this file: this is the only place that knows both halves —
goal.inputsfrom the API andlive.eventsfrom the socket/poll projection. Wiring the merge here (rather than insideuseTaskLiveData) keeps the task detail page untouched.Then swap the two render sites to use the merged lists:
@@ {outputMode === 'readable' - ? <div className="min-h-32 py-4">{thinkingLog.thinkingLogWithTimestamps.length > 0 - ? <ThinkingLog events={thinkingLog.thinkingLogWithTimestamps} todos={live.todos} /> + ? <div className="min-h-32 py-4">{readableTimeline.length > 0 + ? <ThinkingLog events={readableTimeline} todos={live.todos} /> : <p className="text-sm text-slate-500">No human-readable output yet.</p>}</div> - : <div className="mt-4 min-h-32 bg-slate-950 p-4 text-slate-100">{live.events.length > 0 - ? <ExecutionEventLog events={live.events} collapsed={false} onToggleCollapse={() => undefined} lastThought={thinkingLog.lastThought} isTaskActive={mutable && goal.desiredState === 'running'} taskInfo={null} /> + : <div className="mt-4 min-h-32 bg-slate-950 p-4 text-slate-100">{terminalTimeline.length > 0 + ? <ExecutionEventLog events={terminalTimeline} collapsed={false} onToggleCollapse={() => undefined} lastThought={thinkingLog.lastThought} isTaskActive={mutable && goal.desiredState === 'running'} taskInfo={null} /> : <p className="text-sm text-slate-400">No terminal output yet.</p>}</div>}File:
propr-ui/src/components/Goals/goalTimeline.test.ts(new file)Why this file: the ordering rule is the only non-obvious logic in this change. Testing it as a pure function keeps the guarantee ("pending always last") locked in without rendering a page or mocking sockets.
File:
packages/api/test/goalProjection.test.tsWhy this file: it already owns the projection's redaction contract. Extending it here keeps "what the goal endpoint is allowed to return" in one place, including the new path-leak guarantee.
Add a case that seeds
goal_inputswith one of each kind and asserts the filtering, stripping and bounding:File:
propr-ui/src/pages/GoalsPage.test.tsxWhy this file: it is the end-to-end guard for the goal detail view. Asserting here proves the whole chain — API type, merge helper,
ThinkingLogbranch — actually renders, not just that each part compiles.Add
inputsto the existinggoalfixture and a new case:propr-dev commentedon Sep 23, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-52467/claude-opus-5-show-user-corrective-mess-20260923-0819-buvmainissue-2467-20260923-0819-claude-opus-5-buv🔍 Track Task Execution
Implementation complete. Summary of what I built for issue #2467:
feat(ai): All four points and the removal are done, verified by unit …