Repository navigation
Conversation
…renthesis
outcomeForPerson found the end of the first sentence by tracking parentheses. an error with a stray '(' or one cut at 300 characters before its ')' left the depth above zero, so the person read 'check whether it happened before asking the person again'. the known endings now come off first, and the reason is cut by code point.
solquin
requested review from
MikeRyanDev,
davidmckayv,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 6, 2026 20:16
This branch has not been deployed
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 this changes
when an approved step runs out of tries,
notCarriedOutsendsNot done: this action could not be carried out (<reason>). Check whether it happened before asking the person again.outcomeForPersoncuts the second sentence off for the person by finding the first.outside parentheses. the reason iserror.messageas thrown (resume-sweep.ts), so the parentheses inside it are not ours to balance:Unexpected token ( in JSON at position 4leaves the depth at 1, no sentence end is found, and the person reads the whole text, bot's step includedslice(0, 300), which can drop its own), with the same result. long provider and database errors tend to carry parenthesesserver/tests/approval-outcomes-for-person.test.tsguards exactly this leak, but its sample reason isThe disk is full..the fix:
outcomeForPersonstrips the two known endings (ASK_AGAIN,CHECK_BEFORE_ASKING) byendsWithbefore the parenthesis scan. the builders use the same constants, so the strings cannot drift. the scan stays as the fallback for any otherNot done:textnotCarriedOutcuts the reason by code point, sosliceno longer leaves half an emoji (a lone surrogate) in the sentencewhere it runs
shared/outcomeForPerson, it now gets the shorter textboundary and audit
changelog
CHANGELOG.mdunderUnreleasedproof
bun test shared/approval-outcomes.test.ts: two new tests (an unclosed(, a 320-character reason, an emoji at the 300th character) fail onmainand pass with the fixbun test server/tests/approval-outcomes-for-person.test.ts app/tests/computer-activity-conversation.test.tsx: passbunx biome lint --error-on-warningsandbunx biome formaton the changed files: clean.tsc --noEmitinshared/: clean