Repository navigation
fix: restore Pi session tool loadout on resume - #436
Conversation
commit: |
32c9ed9 to
aff3ff7
Compare
|
Rebased onto main db2acfa after #433, #443 and #438 merged. New head: aff3ff7.
|
Independent review: blocked (changes requested)
1. CIAll required checks passed for 2. Review: blocking findingThe restore replaces the startup loadout with the transcript's. Tools from extensions loaded at resume but not active at the session's last run are now dropped.
Concrete failure, reproduced on the built
The same comparison against the installed This trades one dropped-tool bug for another, and the new one affects a wider class of tools. Possible directions, which need a Developer decision because they change resume semantics:
Either way, add a regression test for "an extension tool introduced after the Session was created is active after resume", alongside the existing removal test. Non-blocking notes:
3. Independent verificationRun in a clean reviewer worktree pinned to
Gaps: no real model or real MCP servers (fixtures only). The reconnect race the PR describes was not exercised. I did not run Re-review triggerA new head that resolves the dropped-extension-tool regression, or an explicit Developer decision accepting transcript-replace semantics for resumed Sessions. |
aff3ff7 to
0183aa5
Compare
|
Addresses the blocking finding in #436 (comment). New head: 0183aa5, base main bd1af63.
This needs a fresh independent review of the new head. |
Independent re-review: readyThis follows my earlier record, #436 (comment), which blocked
1. CIAfter waiting for every required check to finish on 2. ReviewThe new hunk makes the following change, only when the session uses the default tools:
The new-session path (
3. Independent verificationRun in a clean reviewer worktree pinned to
Gaps:
Re-review triggerAny new head commit, a base change that touches the Pi patch or the server harness, or a change to the stated resume policy. |
|
Merged the independently reviewed and verified head 0183aa5 (record: #436 (comment)) onto base bd1af63 by squash. Merge commit: e8ad3fa. |
Requirement
When a session is resumed, the deferred MCP tools that
tool_searchloaded into it disappear, so the model can no longer call them (Tool mcp__deferred_tools__weather_lookup not found). Found while verifying #433. Extends the Pi 1.0.2 pnpm patch.Expected behavior
Resuming a Session whose transcript declares a tool loadout:
tool_search, once their servers reconnect;reload()does.New Sessions and an explicit
--tools/--no-toolsare unchanged.Changes and risks
createAgentSessionalways passesinitialActiveToolNamesand falls back to the default tools.AgentSessionrestores the transcript loadout only when that value isundefined, so on this path the restore never runs._pendingToolNames, which re-adds tools after MCP reconnects, is never armed, and the first run records deferred tools as removed.patches/@earendil-works__pi-coding-agent@1.0.2.patch._usesDefaultTools, which is always the case in Pie), it restores the transcript loadout.pnpm-lock.yaml: only the patch hash changes.reload().reload().defaultToolssetting is not turned on for older sessions.Verification
Tested revision:
0183aa59.resume-tool-loadout.test.tsruns the installed Picli.jsover RPC. It dropsbashand runs a turn, then resumes by--session-idwith a newly installed extension tool (probe_tool). It asserts thatbashstays off andprobe_toolis active.bashcomes back).probe_toolmissing).pie-pi-processbundle, with an isolatedPI_CODING_AGENT_DIRand MCP fixtures, resumed the way Pie does:probe_toolactive after resume, and calling it returnsprobe ok.pnpm checkpasses. Server tests: 647 passed, 1 skipped.