Skip to content

fix(planning-session): show the submitted survey answer instead of "skipped" - #7151

Open
superplanehq-integration[bot] wants to merge 5 commits into
mainfrom
fix/survey-response-shows-as-skipped
Open

superplanehq-integration[bot] wants to merge 5 commits into
mainfrom
fix/survey-response-shows-as-skipped

Conversation

@superplanehq-integration

@superplanehq-integration superplanehq-integration Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Task.

Summary

  • In the "New task with an agent" flow, a survey answer that the user picked could show as "Skipped the survey." in the transcript, even though the correct answer was sent to the agent. This fix makes the transcript always show the answer the user submitted.

Problem

  • The transcript combines two sources of text for a user's turn: the reply the user submitted, and the runner's own live log of that turn.
  • When the code matched a submitted survey reply to a live log entry, it only marked that entry as a survey reply. It did not update the entry's text. It kept the live log's own wording for that turn.
  • If the live log worded that turn in a different way, for example a short preview, the transcript could show text that did not match the submitted answer. In some cases this text included the word "skipped", even when the user did pick an answer.
  • The message sent to the agent was correct in all cases. Only the text shown to the user in the transcript was wrong.

UI (web_src)

  • File: web_src/src/pages/factories/pages/planningSessionLog.ts
  • When the merge step finds a live log entry that matches a submitted survey reply, it now replaces that entry's displayed text with the submitted reply text. It still marks the entry as a survey reply so the UI can label it "You (survey response)".
  • The message sent to the agent does not change. This fix only changes what the transcript shows.
  • No changes to other merge logic. Non-survey messages merge the same way as before.

Tests

  • web_src/src/pages/factories/pages/planningSessionLog.spec.ts: added cases that check the submitted answer wins over the live log's own wording, that a partly answered multi-question survey keeps its answered part, and that a fully skipped survey still shows "Skipped the survey.".
  • web_src/src/pages/factories/pages/work-order-split-run/PhaseLogCard.stream.spec.tsx: added a rendering test that mocks a live log entry with "skipped" wording and checks that the transcript shows the real chosen answer instead.

Not changed

  • No API, worker, or database changes. This is a frontend-only display fix.

Created via SuperPlane.

Reviews (4): Last reviewed commit: "fix(planning-session): label the latest ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

…ording

The transcript's survey user note is merged from two sources: the reply
the user actually submitted and the runner's own live log of that turn.
When mergePlanningSessionNotes matched a live note to a submitted survey
reply, it only flagged the live note's userTalk as "survey" and kept
the live log's own wording for that turn. If the live log summarized or
truncated that turn (or otherwise worded it differently), the transcript
could show something other than the chosen answer, including the
literal word "skipped" for a question the user actually answered.

Make the submitted reply the source of truth for what gets displayed:
once a live note is recognized as the match for a survey reply, rewrite
its componentName to the submitted reply text instead of trusting the
live log's own rendering. The exact text sent to the agent is
unchanged; this only affects what is rendered.

Add planningSessionLog.spec.ts cases covering a mismatched live note,
a partially answered multi-question survey, and an all-skipped survey,
plus a PhaseLogCard.stream.spec.tsx case that renders the merged
transcript end-to-end and asserts the chosen answer is shown instead of
"skipped".

Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
Co-authored-by: Pedro Foresti Leão <pedro@superplane.com>
@superplanehq-integration

Copy link
Copy Markdown
Contributor Author

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

@superplanehq-integration

Copy link
Copy Markdown
Contributor Author

Maintainers: comment /deploy-storybook to get a Storybook link for this PR.

Keep main's ordering and this fix's submitted answer rendering.

Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
@forestileao
forestileao force-pushed the fix/survey-response-shows-as-skipped branch from 0ebe411 to 681df0b Compare September 4, 2026 03:23
Comment thread web_src/src/pages/factories/pages/planningSessionLog.ts Outdated
markLiveSurveyReply looped over every root prompt whose first 48 chars
matched the submitted survey reply, which could rewrite and mislabel a
second, unrelated transcript turn. Stop after the first match, matching
stampLiveNoteOrderKey's single-match behavior, and add a test covering
two prompts that share the same survey prefix.

Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
Comment thread web_src/src/pages/factories/pages/planningSessionLog.ts Outdated
…eply

When multiple root prompts share the same 48-character survey-reply
prefix, matching only the first prompt could attribute the submitted
answer to an earlier, unrelated turn while the real survey turn kept the
live log's wording. markLiveSurveyReply now prefers the root prompt whose
live text still spells out the full submitted reply and only falls back
to the first prefix match (a single rewrite) when no prompt carries the
full text, so the label lands on the correct turn without duplicating
another turn.

Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
Comment thread web_src/src/pages/factories/pages/planningSessionLog.ts Outdated
Text position alone cannot decide which root prompt is the real survey
turn: preferring the full-text match mislabels an earlier, unrelated
prompt that carries the reply verbatim when the real (later) turn only
kept a truncated preview. Anchor on chronology instead -- rewrite the
last root prompt that shares the reply's 48-char prefix. This stays a
single rewrite (no duplication) and resolves the earlier-prefix,
later-full-text case too. Update the multi-prompt spec accordingly and
add a case for the earlier-verbatim, later-truncated scenario.

Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
if (`${note.componentName}\n${note.detail ?? ""}`.includes(prefix)) {
note.userTalk = userTalk;
if (noteText(note).includes(prefix)) {
target = note;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Latest match rewrites wrong turn

When the actual survey prompt is followed by another root prompt that repeats or quotes the same 48-character prefix, markLiveSurveyReply retains the later match and rewrites it with the submitted answer, causing the transcript to label the unrelated prompt as the survey response while leaving the actual survey turn unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants