Skip to content

fix(pi): keep refused prompts and time out stalled uploads for 0.1.0 - #5

Merged
aripiprazole merged 2 commits into
mainfrom
build/release-0-1-0
Oct 14, 2026
Merged

aripiprazole merged 2 commits into
mainfrom
build/release-0-1-0

Conversation

@aripiprazole

Copy link
Copy Markdown
Collaborator

Purpose

This prepares 0.1.0. It adds CHANGELOG.md and fixes what a failure audit confirmed. The audit asked: when Leverage fails partway through, does Pi fall back to running anything locally? It doesn't. Leverage's tool calls never reach Pi's tools, and a failed prompt never falls through to a local model. It did find these:

  • A refused prompt was lost. Pi waits 30 s for Leverage to confirm a message, then retries it on its own. If Leverage then refused the retry (runner unavailable, session archived, access revoked), Pi only showed a notice, and the typed text was gone.
    • The text now goes back into the composer, above whatever was typed since. This is a new refused hook on SessionView.
    • The same applies to the retry of the first message, the one that creates a session (recreate).
  • A stalled upload blocked Pi's input. The PUT to storage was the one Leverage call with no timeout, so a stalled upload blocked Pi's input.
    • It now gives up after 30 s like the others, with "The attachment upload timed out.". The message goes back into the composer.
  • The login file was briefly readable. If the file already existed with a looser mode, the tokens were written to it before chmod tightened it. It's now tightened first.

Not fixed here. The audit found three likely issues without tracing them end to end:

  • Pi's selected model can stay on your real provider until Leverage's model list loads.
  • A /name rename that Leverage refuses isn't reverted in Pi.
  • /compact and dequeue report success without waiting for Leverage to confirm.

Publishing. The package still has publishConfig: public, but @leverage/pi isn't on npm and the README installs from git. Whether to publish is still your call. After merging, tag and release:

git tag v0.1.0 && git push origin v0.1.0
gh release create v0.1.0 --notes-file CHANGELOG.md

Verification

All with Bun 1.4.2 from the Nix shell:

  • bun run check passes: Biome, ESLint, tsc, 123 of 123 tests, and the build.
  • New test, refused retry: a message Leverage doesn't confirm is retried, and Leverage refuses the retry. The test expects the text back in the composer and a notice.
  • New test, stalled upload: the fixture's new stallUploads makes storage hang. The test expects the timeout notice, the text back in the composer, and no message sent.
  • Both new tests fail on main: the first never gets the text back, and the second hangs until the test times out.

A message Leverage refused after Pi stopped waiting for it was dropped,
with only a notice. It now goes back into the composer, above whatever
was typed since, both for a session's messages and for the first
message that creates one.

An attachment's upload to storage was the one Leverage call with no
timeout, so a stalled one blocked Pi's input. It now gives up after
30 seconds like the others, and the message goes back to the composer.

A login file kept with a looser mode was tightened only after the
tokens were written to it. It is tightened first.
@aripiprazole
aripiprazole added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit d53a136 Oct 14, 2026
2 checks passed
@aripiprazole
aripiprazole deleted the build/release-0-1-0 branch October 14, 2026 12:45
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