Skip to content

fix(git-info): stop stale polling after session replacement - #414

Open
627150795 wants to merge 1 commit into
openpi-dev:mainfrom
627150795:codex/issue-400-stale-polling
Open

fix(git-info): stop stale polling after session replacement#414
627150795 wants to merge 1 commit into
openpi-dev:mainfrom
627150795:codex/issue-400-stale-polling

Conversation

@627150795

Copy link
Copy Markdown
Contributor

Problem

After rapid session replacement, overlapping session_start handlers could leave polling fibers using an invalidated Pi context. The stale context was then accessed every five seconds and logged a background defect indefinitely.

Value

Stop stale polling without affecting the newest session's refresh loop, and explicitly interrupt polling during session shutdown.

Approach

  • Bind each polling fiber to the session generation and context that created it.
  • Ignore superseded session_start handlers after their previous-fiber interruption completes.
  • Interrupt the tracked polling fiber during shutdown.
  • Add a regression test covering rapid session starts, stale-context access, and continued polling on the newest context.

Validation

  • bun run check
  • node --test --experimental-strip-types tests/extensions/git-info/index.test.ts tests/extensions/git-info/refresh-coordinator.test.ts

The full suite still has one pre-existing Windows failure in tests/extensions/git-info/process.test.ts: a command exiting with code 7 is reported as -1.

Impact

No public API changes. The change is limited to git-info background polling lifecycle and its regression coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant