Repository navigation
fix: codex acp integration - #151
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR implements ACP terminal process management and client integration, refactors run ID generation to use entropy with RunManager allocation/retry wiring, centralizes Codex bootstrap runtime overrides, and introduces a "current_settled" watch state with CodeRabbit commit-status gating and daemon readiness updates. ChangesACP Terminal Process Management
Run ID Generation and Allocation with Entropy
Review Watch Status with Settled State
Codex Configuration Override Standardization
Minor Cleanup and Configuration
🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs:
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/core/agent/terminal.go`:
- Around line 332-337: newTerminalOutputBuffer currently treats a nil or
non-positive limit as "unlimited", which can let a single command exhaust RAM;
change newTerminalOutputBuffer to apply a server-side default cap when limit is
nil or <= 0 (e.g., a constant like defaultOutputByteLimit such as 10*1024*1024
bytes), so resolvedLimit is set to that default instead of 0; update/introduce
the default constant (name: defaultOutputByteLimit) and ensure
terminalOutputBuffer{limit: resolvedLimit} uses that capped value so
OutputByteLimit unset no longer means unlimited.
- Around line 123-129: The code currently calls c.removeTerminal(...) before
terminal.waitFor(ctx), which removes the terminal from c.terminals and can
orphan the subprocess on context deadline; instead, look up the terminal without
removing it (or fetch it from c.terminals directly), call terminal.kill(), wait
for it with terminal.waitFor(ctx), and only after waitFor returns (successful
cleanup or final error) call c.removeTerminal(...) to remove tracking; update
code paths that used removeTerminal(...) to use the non-destructive lookup
first, then call removeTerminal by name/ID after waitFor completes.
In `@internal/core/provider/coderabbit/coderabbit_test.go`:
- Around line 147-175: The test table entries use names that will be passed to
t.Run but do not follow the required "Should ..." pattern; update the name
fields for the affected cases in the test table in coderabbit_test.go (the
entries with headSHA "head-without-review", "head-new" with stale latest
provider review, and "head-new" with stale review + pending status) so each name
begins with "Should ..." (e.g., "Should mark current settled when CodeRabbit
completed current head without a provider review", "Should mark current settled
when CodeRabbit completed current head but latest provider review is stale",
"Should be pending when CodeRabbit is still processing current head with stale
latest review") to comply with the t.Run naming convention.
- Around line 203-218: Wrap the test body of
TestWatchStatusFailsWhenCodeRabbitStatusFailsWithoutProviderReview in a t.Run
subtest whose name starts with "Should" (e.g., t.Run("Should return coderabbit
status failure", func(t *testing.T) { ... })), move the assertions and the call
to New(...).WatchStatus(...) into that subtest, and call t.Parallel()
appropriately (either keep the existing top-level t.Parallel() or call
t.Parallel() inside the subtest) so the test follows the required
t.Run("Should...") pattern while preserving the existing logic and referenced
symbols (TestWatchStatusFailsWhenCodeRabbitStatusFailsWithoutProviderReview,
New, WithCommandRunner, testWatchStatusRunnerWithStatuses, WatchStatus).
In `@internal/daemon/review_watch_test.go`:
- Around line 117-190: Both subtests titled "Should fetch and fix unresolved
reviews when provider settled without a current review object" and "Should
declare clean after provider settled current head and no unresolved reviews
remain" are independent and should be marked parallel; add t.Parallel() as the
first line inside each subtest's anonymous func(t *testing.T) to enable
concurrent execution and follow the test guideline. Locate the two t.Run(...)
blocks in internal/daemon/review_watch_test.go and insert t.Parallel() at the
top of each subtest function body (the funcs passed to t.Run).
In `@internal/daemon/run_manager.go`:
- Around line 1164-1176: The resumeExistingExecRun success path currently
returns createdRun=false which loses the fact the persisted row was touched;
change the return to propagate the `ok` flag returned by `resumeExistingExecRun`
(i.e., return row, ok, nil) so callers like `openRunScopeForStart`/`startRun`
know the row was resumed and can run rollback/terminal-state mirroring; ensure
the code path that calls `resumeExistingExecRun` uses the `ok` boolean instead
of a hardcoded false when deciding cleanup or failure-marking.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6286b4d3-18ef-4071-a2e2-cec777e7f96e
⛔ Files ignored due to path filters (1)
.codex/ledger/2026-05-13-MEMORY-reviews-fix-watch.mdis excluded by!**/*.md
📒 Files selected for processing (16)
.prettierignoreinternal/core/agent/client.gointernal/core/agent/client_test.gointernal/core/agent/registry_specs.gointernal/core/agent/registry_test.gointernal/core/agent/terminal.gointernal/core/model/run_scope.gointernal/core/model/run_scope_internal_test.gointernal/core/provider/coderabbit/coderabbit.gointernal/core/provider/coderabbit/coderabbit_test.gointernal/core/provider/provider.gointernal/core/run/exec/exec.gointernal/daemon/review_watch.gointernal/daemon/review_watch_test.gointernal/daemon/run_manager.gointernal/daemon/run_manager_test.go
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/daemon/run_manager_test.go (1)
1127-1283: ⚡ Quick winWrap new exec-run scenarios in
t.Run("Should...")subtests.Line 1127, Line 1176, and Line 1209 add standalone test cases. Please wrap these scenarios in
t.Run("Should ...")(or table-driven subtests) to match the test-case pattern required for this repo.As per coding guidelines,
**/*_test.go: MUST use t.Run("Should...") pattern for ALL test cases.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/daemon/run_manager_test.go` around lines 1127 - 1283, Wrap each standalone test scenario into a t.Run("Should ...") subtest: for TestRunManagerStartExecRunRetriesImplicitRunIDCollision, TestRunManagerStartExecRunExplicitDuplicateRunIDStillFails, and TestRunManagerStartExecRunAllocatesDistinctImplicitRunIDsInParallel move the current test body into a t.Run call (e.g. t.Run("Should retry implicit run-id collision", func(t *testing.T) { ... })) so the existing setup, channels, env := newRunManagerTestEnv(...), assertions and cleanup remain inside the closure; keep the top-level Test... function as a thin wrapper that calls t.Run so the repo-wide t.Run("Should...") pattern is followed and test semantics are unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@internal/daemon/run_manager_test.go`:
- Around line 1127-1283: Wrap each standalone test scenario into a t.Run("Should
...") subtest: for TestRunManagerStartExecRunRetriesImplicitRunIDCollision,
TestRunManagerStartExecRunExplicitDuplicateRunIDStillFails, and
TestRunManagerStartExecRunAllocatesDistinctImplicitRunIDsInParallel move the
current test body into a t.Run call (e.g. t.Run("Should retry implicit run-id
collision", func(t *testing.T) { ... })) so the existing setup, channels, env :=
newRunManagerTestEnv(...), assertions and cleanup remain inside the closure;
keep the top-level Test... function as a thin wrapper that calls t.Run so the
repo-wide t.Run("Should...") pattern is followed and test semantics are
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fab508d7-c491-4758-998e-0d1d075c6bb5
⛔ Files ignored due to path filters (6)
.compozy/tasks/codex-acp/reviews-001/issue_001.mdis excluded by!**/*.md.compozy/tasks/codex-acp/reviews-001/issue_002.mdis excluded by!**/*.md.compozy/tasks/codex-acp/reviews-001/issue_003.mdis excluded by!**/*.md.compozy/tasks/codex-acp/reviews-001/issue_004.mdis excluded by!**/*.md.compozy/tasks/codex-acp/reviews-001/issue_005.mdis excluded by!**/*.md.compozy/tasks/codex-acp/reviews-001/issue_006.mdis excluded by!**/*.md
📒 Files selected for processing (6)
internal/core/agent/client_test.gointernal/core/agent/terminal.gointernal/core/provider/coderabbit/coderabbit_test.gointernal/daemon/review_watch_test.gointernal/daemon/run_manager.gointernal/daemon/run_manager_test.go
🚧 Files skipped from review as they are similar to previous changes (5)
- internal/daemon/review_watch_test.go
- internal/daemon/run_manager.go
- internal/core/provider/coderabbit/coderabbit_test.go
- internal/core/agent/terminal.go
- internal/core/agent/client_test.go
Summary by CodeRabbit
New Features
Improvements
Tests