Skip to content

docs(protocol): let the lease of an app-ended task still report - #22

Merged
parsilver merged 1 commit into
mainfrom
docs/app-ended-completion
Nov 21, 2026
Merged

parsilver merged 1 commit into
mainfrom
docs/app-ended-completion

Conversation

@parsilver

Copy link
Copy Markdown
Contributor

An app may end a task as completed on 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 next events with 409 invalid_state. The client reads any 409 as "the task is no longer ours" and drops the session without complete, 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 events answer 200 leased with the renewed lease, its complete records duration_ms and usage and answers 200 completed, and its fail is 409 invalid_state. After its complete, the row "completed by L" applies as before.

Docs only. No message or schema changes: the events response is already leased with 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 within tether/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).

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 parsilver left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@parsilver
parsilver merged commit 6d20a0d into main Nov 21, 2026
3 checks passed
@parsilver
parsilver deleted the docs/app-ended-completion branch November 21, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant