MCPcopy Create free account
hub / github.com/anomalyco/opencode-bench / getOrCreateThread

Function getOrCreateThread

src/agents/codex.ts:54–68  ·  view source on GitHub ↗
(model: string, cwd: string)

Source from the content-addressed store, hash-verified

52}
53
54function getOrCreateThread(model: string, cwd: string): Thread {
55 const key = sessionKey(model, cwd);
56 const cached = threadCache.get(key);
57 if (cached) {
58 return cached;
59 }
60
61 const thread = codexClient.startThread({
62 model,
63 sandboxMode: DEFAULT_SANDBOX,
64 workingDirectory: cwd,
65 });
66 threadCache.set(key, thread);
67 return thread;
68}
69
70const codexAgent: Agent.Definition<(typeof models)[number]> = {
71 async run(model, prompt, options) {

Callers 1

runFunction · 0.85

Calls 1

sessionKeyFunction · 0.70

Tested by

no test coverage detected