← Back to PRs

#15852: fix: pass agentId when resolving IRC session paths

by MisterGuy420 open 2026-02-14 00:04 View on GitHub →
stale size: S
## Summary When recovering from Gemini session corruption in the agent runner, the transcript path was being resolved without the `agentId` parameter. This caused IRC messages routed to non-default agents via bindings to fail with the error "Session file path must be within sessions directory" because the path was resolved to the default agent's directory instead of the correct agent-specific directory. ## Changes - Added `agentId` resolution using `resolveAgentIdFromSessionKey(sessionKey)` before calling `resolveSessionTranscriptPath` in the Gemini session corruption recovery path in `src/auto-reply/reply/agent-runner-execution.ts` ## Testing - Ran the existing test suite for the corrupted session recovery: all 4 tests in `agent-runner.heartbeat-typing.runreplyagent-typing-heartbeat.resets-corrupted-gemini-sessions-deletes-transcripts.test.ts` passed - Ran all 5 heartbeat-typing test files: all 20 tests passed Fixes openclaw/openclaw#15846 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the repository agent guidelines (`AGENTS.md`) by adding a new “Post-PR Workspace Cleanup” section with recommended git-only commands for discarding local changes, pruning branches, and handling Edit tool failures. It also touches `CLAUDE.md` (which points to `AGENTS.md`), but introduces a missing newline at EOF. <h3>Confidence Score: 4/5</h3> - This PR is low-risk and mostly safe to merge once the EOF newline issue is fixed. - Changes are documentation-only and don’t affect runtime logic, but the `CLAUDE.md` missing trailing newline will create persistent diff noise and may trip formatting checks/policies. - CLAUDE.md <sub>Last reviewed commit: 58faf0a</sub> <!-- greptile_other_comments_section --> <sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs