fix(transcript): prefix truncation marker#469
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Prefix the truncation marker so long transcripts satisfy the documented contract and the regression test.\n\nValidation:
▶ 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