MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / askAsTheHook

Function askAsTheHook

__tests__/daemon-socket-shared-folder.test.ts:172–179  ·  view source on GitHub ↗

Ask the daemon as the prompt hook does, until it answers: one still opening its index says it is busy.

(root: string)

Source from the content-addressed store, hash-verified

170
171/** Ask the daemon as the prompt hook does, until it answers: one still opening its index says it is busy. */
172async function askAsTheHook(root: string): Promise<DaemonExplore> {
173 const deadline = Date.now() + 30_000;
174 for (;;) {
175 const answer = await exploreViaDaemon(root, 'how does placeOrder work', 15_000);
176 if (answer.status !== 'unavailable' || Date.now() > deadline) return answer;
177 await new Promise((resolve) => setTimeout(resolve, 200));
178 }
179}
180
181describe.runIf(POSIX)('the prompt hook reaches the daemon of a project whose folder others can write to (#3417)', () => {
182 it('reaches it on the temp-directory socket when .codegraph/ is group-writable', async () => {

Calls 1

exploreViaDaemonFunction · 0.90

Tested by

no test coverage detected