fix: use per-session workspaceDir instead of process.cwd() for post-compaction context#18914
Open
irchelper wants to merge 3 commits intoopenclaw:mainfrom
Open
fix: use per-session workspaceDir instead of process.cwd() for post-compaction context#18914irchelper wants to merge 3 commits intoopenclaw:mainfrom
irchelper wants to merge 3 commits intoopenclaw:mainfrom
Conversation
891e3ee to
95871a1
Compare
Contributor
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. |
Contributor
|
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
Closed
7 tasks
eb1b2e0 to
8258737
Compare
2b4a073 to
c505012
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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