fix: use per-session workspaceDir instead of process.cwd() for post-compaction context#18914
fix: use per-session workspaceDir instead of process.cwd() for post-compaction context#18914irchelper wants to merge 3 commits intoopenclaw:mainfrom
Conversation
891e3ee to
95871a1
Compare
Additional Comments (1)
The test file
The PR description says "41/41 agent-runner tests pass" but these are in Prompt To Fix With AIThis is a comment left during a code review.
Path: src/auto-reply/reply/commands-context-report.ts
Line: 1:17
Comment:
**Test file not updated for removed features**
The test file `commands-context-report.test.ts` was not updated alongside these changes. Two assertions will fail:
1. Line 68: `expect(result.text).toContain("Bootstrap max/total: 150,000 chars")` — this output line was removed from both the `"list"` and `"detail"` display paths.
2. Lines 69-72: the bootstrap truncation warning (`"⚠ Bootstrap context is over configured limits"`, `"Causes: ..."`) was completely removed.
The PR description says "41/41 agent-runner tests pass" but these are in `commands-context-report.test.ts`, not the agent-runner test suite. The test expectations need to be updated or removed to match the new behavior.
How can I resolve this? If you propose a fix, please make it concise. |
|
Got it — thanks for the clarification! Since the I'll mark this resolved. The remaining changes look clean:
No further concerns on my end. ✅ |
5f7b346 to
eb1b2e0
Compare
eb1b2e0 to
8258737
Compare
2b4a073 to
c505012
Compare
b6d501e to
c505012
Compare
c505012 to
684c032
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Fixes the
process.cwd()issue identified by @steipete in #18049.Problem
agent-runner.tslines 564 and 599 usedprocess.cwd()to resolve the workspace directory for post-compaction context injection and audit.process.cwd()is process-global and does not follow per-session workspace context, which can cause:AGENTS.md/ bootstrap filesFix
Replace both
process.cwd()calls withfollowupRun.run.workspaceDir, which is the per-session workspace path already passed through fromget-reply-run.ts.Verification
npx tsc --noEmit— zero type errorsfollowupRunconfirmed in scope at both locationsGreptile Summary
This PR replaces
process.cwd()with per-sessionworkspaceDirin two locations withinagent-runner.ts(post-compaction context injection and read audit), fixing a bug where multi-session setups could resolve the wrong workspace. It also inlines and refactorsresolveContextReportincommands-context-report.ts, applying the sameprocess.cwd()→params.workspaceDirfix to thecwdparameter and removingbootstrapTotalMaxCharsfrom the/contextcommand output.agent-runner.ts: Two clean substitutions ofprocess.cwd()→followupRun.run.workspaceDirat lines 564 and 599. Type-safe and correctly scoped.commands-context-report.ts: Inlines logic fromresolveCommandsSystemPromptBundle, fixing an additionalprocess.cwd()usage in thecwdfield. Also removesbootstrapTotalMaxCharsdisplay and bootstrap truncation warnings from/contextoutput.commands-context-report.test.tswas not updated and has assertions that expect the removed"Bootstrap max/total"line and truncation warning text — these tests will fail.Confidence Score: 3/5
src/auto-reply/reply/commands-context-report.ts— requires corresponding test updates incommands-context-report.test.tsLast reviewed commit: 95871a1