Skip to content

fix(pi): deliver onAnswer from afterRun so app onYield hooks cannot skip it - #428

Merged
eersnington merged 1 commit into
stack/feat-pi-conversation-optionsfrom
stack/fix-pi-on-answer-after-run
Dec 3, 2026
Merged

eersnington merged 1 commit into
stack/feat-pi-conversation-optionsfrom
stack/fix-pi-on-answer-after-run

Conversation

@eersnington

Copy link
Copy Markdown
Member

Calls onAnswer from Pi Durable's afterRun hook instead of onYield. Before, an app onYield hook that returned a decision stopped Pi from asking later onYield hooks, so onAnswer never ran.

App onYield review Layer below This PR
Lets the answer stand onAnswer not called called once
Sends a draft back onAnswer not called called once, with the final answer
  • prompt now returns the answer before onAnswer finishes, and the conversation stays busy until it does. This is Pi's afterRun timing. The docs say to call harness.waitForIdle() before reading what onAnswer wrote.
  • A run a tool ends with terminate has no answer, so it does not call onAnswer.
  • The memo key stays the same, so an answer delivered before the upgrade is not delivered again.

This is part 8 of 10 in a stack:

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

📟 Pip-Boy · 87287bf

📦 Packages · fresh npm install resolve, no lockfile · this PR vs base

No notable install size, dependency, or entrypoint changes across 10 packages.

All 10 packages · linux-x64-gnu
package (linux-x64-gnu) @latest base this PR Δ vs base packages
@rivet-dev/pi 405.8 MB 406.7 MB 406.7 MB +853 B (+0.0%) 227 (0)
@rivet-dev/sandbox-adapter 114.5 KB 114.5 KB 114.5 KB 0 1 (0)
@sandbox-agent/cli-shared 27.2 KB 27.2 KB 27.2 KB 0 1 (0)
@sandbox-agent/persist-indexeddb 12.4 KB 12.4 KB 12.4 KB 0 1 (0)
@sandbox-agent/persist-postgres 12.3 KB 12.3 KB 12.3 KB 0 1 (0)
@sandbox-agent/persist-rivet 12.2 KB 12.2 KB 12.2 KB 0 1 (0)
@sandbox-agent/persist-sqlite 12.3 KB 12.3 KB 12.3 KB 0 1 (0)
@sandbox-agent/react 41.6 MB 41.9 MB 41.9 MB 0 15 (0)
acp-http-client 6.7 MB 6.7 MB 6.7 MB 0 3 (0)
sandbox-agent 30.9 MB 30.9 MB 30.9 MB 0 8 (0)

🧹 Rust dependencies

Skipped: this PR doesn't change any Rust code or dependencies.

🦀 Binaries

Skipped: this PR doesn't change any Rust code.

⏱ Timing

job wall time slowest step
zizmor 17s checkout · 10s
changes 21s checkout · 16s
footprint 3m27s Run pnpm --dir sandbox-agent install --frozen-lockfile · 1m05s
⏭ self-test — skipped
⏭ hygiene — skipped
⏭ native · ${{ matrix.platform }} — skipped
report 25s checkout · 9s
🔭 Full CI trace for this commit

One OpenTelemetry trace of CI and Pip-Boy for 87287bf: every job and step, with the sizes above attached. Run after CI finishes.

pnpm install --frozen-lockfile --filter 'pipboy...'
pnpm --filter pipboy pipboy trace --sha 87287bf60985cd5fb6de0c8708bdd6328b2b2b95

Add --otlp <url> to send it to any OTLP/HTTP collector.

Agent instruction: From a rivet-dev/agents checkout, run the commands above, then read the trace file the last command prints. List the slowest jobs and steps and explain where CI time went.

@eersnington
eersnington added this pull request to stack #433 December 3, 2026 19:30
@eersnington
eersnington merged commit 566ba89 into main Dec 3, 2026
10 checks passed
@eersnington
eersnington deleted the stack/fix-pi-on-answer-after-run branch December 3, 2026 19:32
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