Skip to content
Source
Sign inSign up
pingdotgg/t3code

Refresh local git status on turn completion #1821

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/1821/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Summary

  • Refreshes only the cached local git status when a provider turn completes, using the session CWD.
  • Wires turn completion handling in CheckpointReactor to 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.ts for turn completion refresh behavior.
  • Existing test coverage added in apps/server/src/git/Layers/GitStatusBroadcaster.test.ts for 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.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 883489c5aaf377ca0751422ded937c774037fbf6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Refresh local git status on turn completion in CheckpointReactor

  • Adds refreshLocalStatus(cwd) to the GitStatusBroadcasterShape interface and implements it in GitStatusBroadcasterLive, normalizing the cwd before invalidating and reloading the local git status cache.
  • On turn.completed events, CheckpointReactorLive now calls gitStatusBroadcaster.refreshLocalStatus with the session cwd before capturing a checkpoint; failures log a warning and do not block the checkpoint.
  • Test harnesses for both CheckpointReactor and the orchestration integration layer are updated to inject a stub GitStatusBroadcaster that records refreshLocalStatus calls.
Macroscope summarized 883489c.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 419f64a8-4a74-4a69-b89c-1daaecf37074

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `t3code/turn-completion-invalidation`

      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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 883489c. Prior analysis still applies.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. juliusmarminge merged this2aa7398

    5. juliusmarminge closed this

Sign in to join this conversation.