consolidate checkout status handling and improve git detection

This commit is contained in:
Mohamed Boudra
2026-02-03 14:50:15 +07:00
parent ad632cb3bd
commit 14b0db55b0
12 changed files with 369 additions and 188 deletions
@@ -39,7 +39,7 @@ describe("useCheckoutStatusQuery", () => {
describe("nextCheckoutStatusRefetchDecision", () => {
it("refetches only once per key until reset", () => {
const key = "daemon-1:agent-1";
const key = "daemon-1:/path/to/project";
expect(nextCheckoutStatusRefetchDecision(null, key)).toEqual({
nextSeenKey: key,
@@ -62,11 +62,11 @@ describe("useCheckoutStatusQuery", () => {
});
});
it("refetches again when agent changes while active", () => {
it("refetches again when cwd changes while active", () => {
expect(
nextCheckoutStatusRefetchDecision("daemon-1:agent-1", "daemon-1:agent-2")
nextCheckoutStatusRefetchDecision("daemon-1:/path/a", "daemon-1:/path/b")
).toEqual({
nextSeenKey: "daemon-1:agent-2",
nextSeenKey: "daemon-1:/path/b",
shouldRefetch: true,
});
});