Repository navigation
docs(protocol): let the lease of an app-ended task still report - #22
Merged
Merged
Conversation
An app may end a task as completed on its own while the lease runs, for example when the agent asks the user a question and the answer becomes a new task. Section 12 had that task refuse the lease's events, so the client dropped the session before complete and the app lost the run's duration and usage. The note keeps that lease the completing one until it sends complete.
parsilver
commented
Nov 21, 2026
parsilver
left a comment
Contributor
Author
There was a problem hiding this comment.
Verdict: no Blocker. The note matches paper's implementation in parsilver/paper.farzai.com#86: L stays the completing lease, events answer 200 leased, complete records duration and usage, fail is 409 invalid_state, and clients need no change. Docs only; CI 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.
An app may end a task as
completedon its own while the lease still runs. paper does this when the agent asks the user a question: the task waits on the user, and the answer becomes a new task. Section 12 then had the task refuse the lease's nexteventswith409 invalid_state. The client reads any 409 as "the task is no longer ours" and drops the session withoutcomplete, so the app never gets the run's duration and usage.This adds a note to section 12: until that lease reports, it stays the completing lease. Its
eventsanswer200 leasedwith the renewed lease, itscompleterecordsduration_msandusageand answers200 completed, and itsfailis409 invalid_state. After itscomplete, the row "completed by L" applies as before.Docs only. No message or schema changes: the events response is already
leasedwith a lease, and the client reports as it always does. The fake app server never ends a task on its own, and the conformance suite has no way to put a task in this state, so neither changes. The rule is a MAY for apps, additive withintether/1.paper's side: parsilver/paper.farzai.com#86 (issue parsilver/paper.farzai.com#84).
Checks:
bunx vitest run test/protocol-doc.test.ts(83 passed),bun run lint(clean).