Skip to content

fix(transcript): prefix truncation marker#469

Merged
devinoldenburg merged 1 commit into
mainfrom
devinoldenburg/merge-and-release
Jul 8, 2026
Merged

fix(transcript): prefix truncation marker#469
devinoldenburg merged 1 commit into
mainfrom
devinoldenburg/merge-and-release

Conversation

@devinoldenburg

Copy link
Copy Markdown
Owner

Prefix the truncation marker so long transcripts satisfy the documented contract and the regression test.\n\nValidation:

opencode-goal-mode@0.9.4 test
node --test

▶ resolveConfig
✔ applies env over defaults (0.46525ms)
✔ plugin options win over env (0.081292ms)
✔ keeps defaults when empty options (0.074ms)
✔ resolveConfig (1.400541ms)
▶ parseModelRef
✔ parses provider/model (0.465875ms)
✔ returns null for invalid (0.0685ms)
✔ parseModelRef (0.622792ms)
▶ parseEvaluatorResponse
✔ parses YES with reason (0.463708ms)
✔ parses NO with reason (0.182ms)
✔ rejects garbage (0.088042ms)
✔ parseEvaluatorResponse (1.626959ms)
▶ buildEvaluatorPrompt
✔ includes the completion condition in the prompt (0.112041ms)
✔ includes the transcript in the prompt (0.045292ms)
✔ handles empty transcript gracefully (0.039125ms)
✔ handles null-ish transcript gracefully (0.053625ms)
✔ asks for YES or NO format (0.069791ms)
✔ handles very long conditions without truncating the format instructions (0.077791ms)
✔ handles conditions with special characters (0.05975ms)
✔ produces deterministic output for the same inputs (0.04425ms)
✔ buildEvaluatorPrompt (0.660834ms)
▶ install.mjs
✔ dry-run and install into temp target (63.122208ms)
✔ install.mjs (63.546125ms)
▶ decideAfterIdle
✔ no-ops without condition (0.4535ms)
✔ no-ops when not on goal agent (0.302958ms)
✔ achieves on evaluator YES (0.927667ms)
✔ continues on evaluator NO (0.130417ms)
✔ pauses on no-progress streak (0.071708ms)
✔ honours abort suppress window (0.071166ms)
✔ exports consecutive cap constant (0.043541ms)
✔ decideAfterIdle (3.040917ms)
▶ goal_set gates idle loop
✔ goal_set sets condition (0.900583ms)
✔ chat.params tracks goal agent (0.370167ms)
✔ goal_set gates idle loop (1.620875ms)
✔ synthetic goal turns keep the session on the Goal agent (0.152417ms)
▶ buildAchievedSummaryBody
✔ asks for Goal Completed summary without re-verification (0.57525ms)
✔ buildAchievedSummaryBody (1.125792ms)
▶ buildContinuationBody
✔ discourages completion summary on continue (0.624083ms)
✔ buildContinuationBody (0.706542ms)
▶ resolveSessionApi
✔ uses v2 flat params for promptAsync on the injected SDK client (0.652417ms)
✔ falls back to v1 { path, body } shape when flat params throw (0.160292ms)
✔ uses HTTP when SDK client is unavailable and serverUrl is set (12.204291ms)
✔ resolveSessionApi (13.71325ms)
▶ formatTranscript
✔ returns empty string for empty messages (0.790916ms)
✔ returns empty string for messages with no text parts (0.093209ms)
✔ labels user and assistant messages (0.274333ms)
✔ labels agent messages as assistant (0.113541ms)
✔ skips synthetic parts (0.109584ms)
✔ handles non-text parts gracefully (0.068458ms)
✔ handles parts with content field instead of text (0.0625ms)
✔ detects role from m.role when info.role is absent (0.049917ms)
✔ defaults to user when role and agent are both absent (0.081083ms)
✔ applies truncation when transcript is very large (0.973416ms)
✔ does not truncate short transcripts (0.104333ms)
✔ handles messages from info.parts when m.parts is absent (0.081459ms)
✔ formatTranscript (3.420667ms)
▶ lastAssistantText
✔ returns last assistant text (0.107917ms)
✔ skips synthetic parts (0.043166ms)
✔ returns empty string when no assistant messages exist (0.05975ms)
✔ returns empty string for empty array (0.026209ms)
✔ handles agent-labeled messages as assistant (0.047625ms)
✔ handles multibyte characters (0.03725ms)
✔ lastAssistantText (0.41775ms)
ℹ tests 50
ℹ suites 12
ℹ pass 50
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 109.613167

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 19:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@devinoldenburg devinoldenburg merged commit cc636df into main Jul 8, 2026
5 checks passed
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