feat: Phase 4 teardown — remove Go codecontext sidecar from deployment

- Remove codecontext service block from docker-compose.yml
- Remove CODECONTEXT_URL env var
- Delete codecontext/Dockerfile
- Update callCodecontext() to try boocontext MCP first with HTTP fallback
- Graceful degradation: if boocontext MCP unavailable, tools still work via HTTP
This commit is contained in:
2026-06-08 02:16:02 +00:00
parent 917a229363
commit 7cb692d8be
3 changed files with 11 additions and 92 deletions

View File

@@ -26,6 +26,7 @@
import { access, copyFile, realpath } from 'node:fs/promises';
import { isAbsolute, join, resolve, sep } from 'node:path';
import { truncateIfNeeded } from './truncate.js';
import { callBoocontext } from './boocontext_client.js';
// v1.13.12 fix: codecontext crashes on empty source files (upstream issue #37)
// when it can't ignore them. The .codecontextignore.template ships with the
@@ -119,11 +120,16 @@ export async function callCodecontext(
req: CodecontextRequest,
fetcher: typeof fetch = fetch,
): Promise<CodecontextResponse> {
// DEPRECATED: This function routes through the Go codecontext sidecar at
// http://codecontext:8080. New callers should use boocontext MCP instead.
console.warn(
`[deprecated] callCodecontext("${req.toolName}") — route through boocontext MCP instead`,
);
// Phase 4: try boocontext MCP first. Falls back to the HTTP sidecar if the
// MCP server is not available or the tool doesn't exist there.
try {
return await callBoocontext({ toolName: req.toolName, args: req.args });
} catch (err) {
console.warn(
`[codecontext_client] boocontext MCP unavailable for "${req.toolName}", falling back to HTTP sidecar: ${err instanceof Error ? err.message : String(err)}`,
);
}
// Step 1: realpath the project root, then realpath the requested target_dir
// (defaulting to projectPath when the caller didn't pass one — the 12 wrappers
// never pass target_dir; tests can override). A non-existent target_dir