Repository navigation
Conversation
5 tasks done
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.
Closes #893
Split out from #899 per review feedback, with
job_outputandwait: truealso scoped out of comments and string literals.What was wrong
WAITINGinsrc/ptc/batching-guidance.tsdid not recognizetools.wait_agent(...)ortools["wait_agent"](...)calls, andviolationsOf(shape)did not excludeshape.isWaitingfrom theshapeviolation. In addition,WAITINGmatched against rawcode, so// job_output(or"wait: true"inside a comment or string literal still setisWaiting.violationsOf(shape)triggered onshape.dispatchSites >= 1whenever a short program had no loop/Promise.all/branching, misclassifying sequential multi-dispatch scripts (such as agrepwhose result determines the nextread_file) as"The program ran a single operation".The change
src/ptc/batching-guidance.ts:wait_agentandjob_outputonly at realtools.*/tools["..."]dispatch sites (WAITING_TOOL = /^(?:wait_agent|job_output)$/u) and matchwait: trueagainstreadable.bare, so comments and string literals never setisWaiting.shapeviolation condition inviolationsOf(shape)toshape.dispatchSites === 1 && !shape.hasBatchingStructure && !shape.hasBranching && !shape.isWaiting && shape.chars < THIN_CODE_CHARS.test/batching-trigger.test.mjs&docs/CHANGELOG.md:wait_agent, comment/string counterexamples forwait_agent,job_outputandwait: true, dependent multi-dispatch programs, single-read regression, and independence ofplan/bypasschecks.## [Unreleased]entry indocs/CHANGELOG.md.Validation
pull_request-triggeredCI requiredrun, URL belownpm run build,npm run typecheck,npm run check:size, andnode test/run.mjs batching-triggerpasssrc/ptc/batching-guidance.tsturns the two new assertions inbatching-triggerreddocs/CHANGELOG.md## [Unreleased]entry added (English and Chinese)package.jsonversion, oroptionalDependencieschange; no model-facing schema/prompt changeRevert-red verification:
Environment
Linux x64, Node v22.22.1, based on upstream
maincommit88ecc72, local source checkout.