Compare commits

...

5 Commits

Author SHA1 Message Date
917a229363 feat: Domain 2 Phase 3-4 — wiki article tool, DCP compress toggle, Go sidecar deprecation
Phase 3: get_wiki_article tool wraps codesight_get_wiki_article MCP
(cached, persistent codebase wiki). DCP compress toggle on
get_codebase_overview (compress=true for large projects >50 files).

Phase 4: Deprecation markers on Go codecontext sidecar. Warning log
in callCodecontext(), deprecation comments in factory.ts and
docker-compose.yml. Sidecar remains functional — removal deferred.
2026-06-08 01:35:40 +00:00
39be5ce413 fix: move cache_tokens/reasoning_tokens ALTER TABLE before view creation 2026-06-08 01:32:25 +00:00
378e29308e fix: add cache_tokens/reasoning_tokens to Message constructors in useSessionStream 2026-06-08 01:27:31 +00:00
8f6a814ab0 fix: add cache_tokens/reasoning_tokens to web WsFrame union 2026-06-08 01:26:01 +00:00
3c019a2281 changelog: v2.8.18-deepseek-whale-lift 2026-06-08 01:24:59 +00:00
10 changed files with 84 additions and 3 deletions

View File

@@ -2,6 +2,10 @@
All notable changes per release tag. Most recent on top, ordered by tag creation date (which matches the git history). Tag names follow `vMAJOR.MINOR.PATCH-slug` — the slug describes what shipped, so the tag name alone is enough to recall the batch. All notable changes per release tag. Most recent on top, ordered by tag creation date (which matches the git history). Tag names follow `vMAJOR.MINOR.PATCH-slug` — the slug describes what shipped, so the tag name alone is enough to recall the batch.
## v2.8.18-deepseek-whale-lift — 2026-06-08
Integrates DeepSeek API directly into BooChat and BooCoder via `@ai-sdk/deepseek`, replacing the generic `openai-compatible` wrapper. DeepSeek V4 models (`deepseek-v4-flash`, `deepseek-v4-pro`) with configurable thinking effort levels appear in both chat and coder pane model pickers. Full token tracking — cache hit tokens and reasoning tokens — flow from the API through new DB columns and WS frames into the UI message stats line. Lifts three high-value features from the Whale codebase: a schema-based tool input repair system that coerces types and unwraps markdown autolinks before Zod validation, a shell-based lifecycle hooks system (PreToolUse, PostToolUse, Stop, PreCompact, PostCompact) with JSON stdin/stdout contract, and per-MCP-server permissions (allow/ask/deny) gating tool execution.
## v2.8.0-fork-lifts — 2026-06-07 ## v2.8.0-fork-lifts — 2026-06-07
Completes the eight fork-lift integrations from `/opt/forks` into BooCode: boocontext sidecar upgrade, LSP code intelligence, DCP clean-room pruning, institutional memory, subagent protocol enhancements, plugin hook host, inference reliability (tool-shim + loop detectors), and TokenScope token breakdown. Backfills edit safety guards (truncation + dropped imports) and the TokenScope analyzer/persist module. Closes the fork-lifts-mit epic. Completes the eight fork-lift integrations from `/opt/forks` into BooCode: boocontext sidecar upgrade, LSP code intelligence, DCP clean-room pruning, institutional memory, subagent protocol enhancements, plugin hook host, inference reliability (tool-shim + loop detectors), and TokenScope token breakdown. Backfills edit safety guards (truncation + dropped imports) and the TokenScope analyzer/persist module. Closes the fork-lifts-mit epic.

View File

@@ -32,11 +32,18 @@ CREATE TABLE IF NOT EXISTS messages (
content TEXT NOT NULL DEFAULT '', content TEXT NOT NULL DEFAULT '',
status TEXT NOT NULL DEFAULT 'complete', status TEXT NOT NULL DEFAULT 'complete',
last_seq INT NOT NULL DEFAULT 0, last_seq INT NOT NULL DEFAULT 0,
cache_tokens INTEGER,
reasoning_tokens INTEGER,
created_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp() created_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp()
); );
CREATE INDEX IF NOT EXISTS idx_messages_session ON messages(session_id, created_at); CREATE INDEX IF NOT EXISTS idx_messages_session ON messages(session_id, created_at);
-- vDeepSeek: add cache/reasoning token columns early so messages_with_parts
-- view (defined below) can reference them. IF NOT EXISTS guards re-runs.
ALTER TABLE messages ADD COLUMN IF NOT EXISTS cache_tokens INTEGER;
ALTER TABLE messages ADD COLUMN IF NOT EXISTS reasoning_tokens INTEGER;
-- v1.13.0: granular message parts table. v1.13.20: legacy tool_calls/ -- v1.13.0: granular message parts table. v1.13.20: legacy tool_calls/
-- tool_results columns dropped; message_parts is now the sole source of -- tool_results columns dropped; message_parts is now the sole source of
-- truth for tool calls, tool results, and reasoning. ON DELETE CASCADE -- truth for tool calls, tool results, and reasoning. ON DELETE CASCADE
@@ -204,8 +211,6 @@ ALTER TABLE messages ADD COLUMN IF NOT EXISTS ctx_used INTEGER;
ALTER TABLE messages ADD COLUMN IF NOT EXISTS ctx_max INTEGER; ALTER TABLE messages ADD COLUMN IF NOT EXISTS ctx_max INTEGER;
ALTER TABLE messages ADD COLUMN IF NOT EXISTS started_at TIMESTAMPTZ; ALTER TABLE messages ADD COLUMN IF NOT EXISTS started_at TIMESTAMPTZ;
ALTER TABLE messages ADD COLUMN IF NOT EXISTS finished_at TIMESTAMPTZ; ALTER TABLE messages ADD COLUMN IF NOT EXISTS finished_at TIMESTAMPTZ;
ALTER TABLE messages ADD COLUMN IF NOT EXISTS cache_tokens INTEGER;
ALTER TABLE messages ADD COLUMN IF NOT EXISTS reasoning_tokens INTEGER;
ALTER TABLE sessions ADD COLUMN IF NOT EXISTS updated_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp(); ALTER TABLE sessions ADD COLUMN IF NOT EXISTS updated_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp();

View File

@@ -1,3 +1,10 @@
// DEPRECATED (Phase 4, Domain 2, v2.8.14): This HTTP client routes through
// the Go codecontext sidecar (http://codecontext:8080). Superseded by the
// boocontext MCP server. New callers should use boocontext MCP tool wrappers
// directly. Keep this file for backward compatibility — the 16 existing
// codecontext tool wrappers (under tools/codecontext/) still call through
// callCodecontext(). Remove after full migration.
//
// v1.12 Track B.2: shared HTTP client for the codecontext sidecar. The 8 // v1.12 Track B.2: shared HTTP client for the codecontext sidecar. The 8
// per-tool wrappers under tools/codecontext/ all funnel through callCodecontext // per-tool wrappers under tools/codecontext/ all funnel through callCodecontext
// — they're thin adapters that supply toolName + args + projectPath. The // — they're thin adapters that supply toolName + args + projectPath. The
@@ -112,6 +119,11 @@ export async function callCodecontext(
req: CodecontextRequest, req: CodecontextRequest,
fetcher: typeof fetch = fetch, fetcher: typeof fetch = fetch,
): Promise<CodecontextResponse> { ): 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`,
);
// Step 1: realpath the project root, then realpath the requested target_dir // 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 // (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 // never pass target_dir; tests can override). A non-existent target_dir

View File

@@ -2,6 +2,12 @@ import { z } from 'zod';
import type { ToolDef } from '../types.js'; import type { ToolDef } from '../types.js';
import { callCodecontext, type CodecontextResponse } from '../../codecontext_client.js'; import { callCodecontext, type CodecontextResponse } from '../../codecontext_client.js';
// DEPRECATED (Phase 4, Domain 2, v2.8.14): This factory builds ToolDefs that
// route through the Go codecontext sidecar via callCodecontext(). Superseded
// by direct boocontext MCP tool wrappers. Keep functional for backward
// compatibility — old codecontext tools still use HTTP. New tools should use
// the boocontext MCP server instead of adding entries here.
//
// Shared factory for the 12 codecontext shim ToolDefs. // Shared factory for the 12 codecontext shim ToolDefs.
// Each shim provides name/schema/description/jsonParameters/mapArgs; the // Each shim provides name/schema/description/jsonParameters/mapArgs; the
// factory builds the ToolDef and returns both the ToolDef and the standalone // factory builds the ToolDef and returns both the ToolDef and the standalone

View File

@@ -3,6 +3,7 @@ import { makeCodecontextTool } from './factory.js';
export const GetCodebaseOverviewInput = z.object({ export const GetCodebaseOverviewInput = z.object({
include_stats: z.boolean().optional(), include_stats: z.boolean().optional(),
compress: z.boolean().optional().describe('Apply DCP compression for large projects (>50 files)'),
}); });
export type GetCodebaseOverviewInputT = z.infer<typeof GetCodebaseOverviewInput>; export type GetCodebaseOverviewInputT = z.infer<typeof GetCodebaseOverviewInput>;
@@ -24,10 +25,18 @@ const { toolDef: getCodebaseOverview, execute: executeGetCodebaseOverview } =
type: 'boolean', type: 'boolean',
description: 'Include file count, symbol count, language stats. Defaults to true.', description: 'Include file count, symbol count, language stats. Defaults to true.',
}, },
compress: {
type: 'boolean',
description: 'Apply DCP compression for large projects (>50 files)',
},
}, },
additionalProperties: false, additionalProperties: false,
}, },
mapArgs: (input) => ({ include_stats: input.include_stats ?? true }), mapArgs: (input) => {
const args: Record<string, unknown> = { include_stats: input.include_stats ?? true };
if (input.compress) args['compress'] = true;
return args;
},
}); });
export { getCodebaseOverview, executeGetCodebaseOverview }; export { getCodebaseOverview, executeGetCodebaseOverview };

View File

@@ -18,3 +18,4 @@ export { getCodeHealth } from './get_code_health.js';
export { getCodeImpact } from './get_code_impact.js'; export { getCodeImpact } from './get_code_impact.js';
export { getTypeInfo } from './get_type_info.js'; export { getTypeInfo } from './get_type_info.js';
export { getCodeMap } from './get_code_map.js'; export { getCodeMap } from './get_code_map.js';
export { getWikiArticle } from './get_wiki_article.js';

View File

@@ -532,6 +532,8 @@ export type WsFrame =
tokens_used?: number | null; tokens_used?: number | null;
ctx_used?: number | null; ctx_used?: number | null;
ctx_max?: number | null; ctx_max?: number | null;
cache_tokens?: number | null;
reasoning_tokens?: number | null;
started_at?: string | null; started_at?: string | null;
finished_at?: string | null; finished_at?: string | null;
// model-attribution: the model that produced this assistant message. // model-attribution: the model that produced this assistant message.

View File

@@ -40,6 +40,8 @@ function applyFrame(state: State, frame: WsFrame): State {
tokens_used: null, tokens_used: null,
ctx_used: null, ctx_used: null,
ctx_max: null, ctx_max: null,
cache_tokens: null,
reasoning_tokens: null,
model: null, model: null,
started_at: null, started_at: null,
finished_at: null, finished_at: null,
@@ -106,6 +108,8 @@ function applyFrame(state: State, frame: WsFrame): State {
tokens_used: null, tokens_used: null,
ctx_used: null, ctx_used: null,
ctx_max: null, ctx_max: null,
cache_tokens: null,
reasoning_tokens: null,
model: null, model: null,
started_at: null, started_at: null,
finished_at: null, finished_at: null,

31
codecontext/README.md Normal file
View File

@@ -0,0 +1,31 @@
# codecontext — Go sidecar (DEPRECATED)
> **Deprecated** (Phase 4, Domain 2, v2.8.14).
>
> Superseded by the **boocontext MCP server** (`apps/coder`). Do not add new
> callers. The 16 codecontext tool wrappers still use this sidecar via HTTP at
> `http://codecontext:8080/v1/{toolName}` for backward compatibility.
## Migration path
1. Existing tool wrappers in `apps/server/src/services/tools/codecontext/` route
through `callCodecontext()` in `codecontext_client.ts`, which calls this
Go sidecar over HTTP.
2. New callers should use the boocontext MCP server instead (reachable via the
`boocontext` tool wrappers).
3. After all callers have migrated, remove this directory, the `codecontext`
service block from `docker-compose.yml`, and the
`codecontext_client.ts`/`factory.ts` files.
## What it does
A Go HTTP shim wrapping the boocontext MCP server's stdio interface. Provides
code-graph analysis (symbols, callers, callees, file overview, etc.) over a
REST API at `/v1/{toolName}`.
## Files
- `shim.go` — HTTP server that wraps the boocontext MCP stdio process
- `Dockerfile` — container build
- `fork.tar.gz` — vendored boocontext source (gitignored)
- `.codecontextignore.template` — default ignore patterns deployed per project

View File

@@ -95,6 +95,13 @@ services:
# HTTP shim (see ./codecontext/). No host port — reached from boocode at # HTTP shim (see ./codecontext/). No host port — reached from boocode at
# http://codecontext:8080 over the boocode_net bridge. # http://codecontext:8080 over the boocode_net bridge.
# #
# DEPRECATED (Phase 4, Domain 2, v2.8.14): Superseded by the boocontext
# MCP server. The 16 codecontext tool wrappers still use this sidecar via
# HTTP but should route through the boocontext MCP instead. Keep the
# service running for backward compatibility until all callers migrate.
# Remove this block after full migration — see codecontext_client.ts and
# factory.ts for deprecation markers.
#
# Mounts /opt:/opt:ro (not just /opt/projects:ro): BooCode projects live # Mounts /opt:/opt:ro (not just /opt/projects:ro): BooCode projects live
# at /opt/<slug> on the host, not exclusively under /opt/projects. The # at /opt/<slug> on the host, not exclusively under /opt/projects. The
# mount must cover anywhere a project.path could resolve to. Read-only # mount must cover anywhere a project.path could resolve to. Read-only