# Issue 24797 runtime reproduction

Base: a96cf0818e (current main), Linux fs-01, real `vp run dev` server on 16541 and web on 8501. Browser: T3 collaborative Chromium, 1280x800. Isolated home: task worktree/.t3. No live database writes.

1. `git init -b main /tmp/issue-24797-repro/repo`; create an empty commit; add origin https://git.cafe/pingdotgg/t3code.git.
2. `git -C /tmp/issue-24797-repro/repo worktree add -b issue-24797-fixture /tmp/issue-24797-repro/worktree`.
3. Pair browser with the dev environment. Invoke real WebSocket RPC `projects.mutate` with project.create, projectId issue-24797-fixture, title Issue 24797 fixture, workspaceRoot /tmp/issue-24797-repro/repo, scripts [].
4. Invoke `orchestration.dispatchCommand` thread.create with threadId issue-24797-thread, projectId issue-24797-fixture, title PR poller fixture, createdBy user, creationSource web, modelSelection {instanceId: codex, model: gpt-6.1-sol}, runtimeMode full-access, interactionMode default, branch issue-24797-fixture, worktreePath /tmp/issue-24797-repro/worktree. No agent turn is started.
5. Observe successful GitManager.branchPullRequest.remotes for that worktree in server.trace.ndjson.
6. `rm /tmp/issue-24797-repro/worktree/.git`. The empty-commit worktree is now an existing empty folder.
7. Invoke thread.unsettle (reason user), and thread.settle then thread.unsettle again as needed to refresh without waiting for the local git cache. Each command has a fresh commandId. Leave thread unsettled.
8. Observe repeat GitManager.branchPullRequest.remotes failures with not_a_repository at the same empty folder. before-runtime.json contains the extracted real server spans. No mock git or provider is used.

The normal periodic sweep also discovers PRs when a foreground client has an activity lease. Explicit thread events exercise the same worker and force fresh git reads; this avoids waiting for cached successful git state to expire.

Only server behavior changes; no changed render path or visual matrix applies.
