Repository navigation
refactor(unit)!: rename handle.resume() to handle.ask() - #37
Merged
Merged
Conversation
`resume` was the wrong name in a codebase that already has `resumeRun` (restart a
whole Run from its journal, RPC `resumeRun`, input `ResumeRunInput`). Four meanings
of one word makes every reader stop and disambiguate, and the semantics differ:
`resumeRun` continues an INTERRUPTED Run, while this sends a new question into a
session whose last turn finished successfully.
`ask` says what it does — ask the same conversation something else — and leaves
`resume` to the Run. No behavioural change: `handle.ask(prompt, opts)` is the same
call as before, still sugar over `agent(prompt, { session, keepSession: true })`.
BREAKING CHANGE: `UnitHandle.resume()` is now `UnitHandle.ask()`. The API was
merged but has not shipped in a release yet, so no published version is affected;
for a Workflow written against the branch, rename `handle.resume(` to
`handle.ask(`.
Also rename the same-word docs and examples (README "Continuing a Unit", the
`dynamic-workflows` skill, `docs/examples/review-loop.ts`) so nobody learns the
old name.
Verified: `bun run check` — 427 tests, format/lint/types green.
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.
Follow-up to #34. Renames the handle method before the API ships in a release.
Why
resumewas already taken — and meant something else:service.resumeRun()/ RPCresumeRun/ResumeRunInput→handle.resume()handle.ask()Four meanings of one word in one codebase is a trap: a reader has to stop and disambiguate every time, and the
semantics genuinely differ — resuming implies continuing something interrupted, whereas this asks the same
conversation something new.
What changed
askis identical in behaviour: still sugar overagent(prompt, { session, keepSession: true }), still refusessession/keepSession/receipts, still sequential per session, still per-turn usage andtoolCalls.Also renamed in the places people learn it from: README ("Continuing a Unit"), the
dynamic-workflowsskill,docs/examples/review-loop.ts, the type-level tests, and the failure message (ask: Unit … never had a session).The JSDoc on
UnitHandle.asknow says whyaskand notresume, so the decision is not re-litigated later.Breaking change
UnitHandle.resume()→UnitHandle.ask(). The feature merged in #34 but has not shipped in a release (0.6.3 isstill current), so no published version is affected; for a Workflow written against
main, renamehandle.resume(tohandle.ask(.Verification
bun run check— 427 tests, format/lint/types greensync-readmerun (the npm README copy matches)handle.resumeleft anywhere: checkedsrc,test,docs/examples, README and the skill. The remaining"resume" occurrences all refer to a Run (
resumeRun, replay on resume), which is the point of the rename.