Refresh local git status on turn completion #1821
main fromrefs/pull/1821/head·merged by juliusmarminge View on GitHubSummary#
- Refreshes only the cached local git status when a provider turn completes, using the session CWD.
- Wires turn completion handling in
CheckpointReactorto trigger a local status refresh without forcing a full status recompute. - Adds coverage for the new local-refresh path and updates git status broadcaster tests for cache invalidation behavior.
Testing#
- Not run (PR description only).
- Existing test coverage added in
apps/server/src/orchestration/Layers/CheckpointReactor.test.tsfor turn completion refresh behavior. - Existing test coverage added in
apps/server/src/git/Layers/GitStatusBroadcaster.test.tsfor local snapshot refresh and cache invalidation.
Note
Medium Risk
Touches turn completion handling in CheckpointReactor and git status caching behavior, which can affect UI/status freshness and checkpoint flow timing. Failures are caught and only warn, but incorrect CWD normalization or session resolution could cause missed/extra refreshes.
Overview
On provider turn.completed, CheckpointReactor now triggers a local-only git status cache refresh via GitStatusBroadcaster.refreshLocalStatus(session.cwd) before capturing the post-turn checkpoint; refresh failures are logged and do not block checkpointing.
GitStatusBroadcaster adds a new refreshLocalStatus(cwd) API (including CWD normalization) to invalidate/reload just the local snapshot without forcing a remote refresh, with new test coverage validating local-only invalidation and updated harnesses stubbing the new service dependency.
Note
Refresh local git status on turn completion in CheckpointReactor#
- Adds
refreshLocalStatus(cwd)to theGitStatusBroadcasterShapeinterface and implements it inGitStatusBroadcasterLive, normalizing the cwd before invalidating and reloading the local git status cache. - On
turn.completedevents,CheckpointReactorLivenow callsgitStatusBroadcaster.refreshLocalStatuswith the session cwd before capturing a checkpoint; failures log a warning and do not block the checkpoint. - Test harnesses for both
CheckpointReactorand the orchestration integration layer are updated to inject a stubGitStatusBroadcasterthat recordsrefreshLocalStatuscalls.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Needs human review
This PR adds new automatic runtime behavior that triggers git status refresh on every turn completion. While well-tested and authored by a primary contributor to these files, the addition of new observable behavior that runs automatically warrants human review.
No code changes detected at
You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).883489c. Prior analysis still applies.juliusmarminge merged this2aa7398
juliusmarminge closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
419f64a8-4a74-4a69-b89c-1daaecf37074You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands and usage tips.