Phase 003: remove the coding-agent and ekko-agent runtimes

Every chat session now runs through the Hermes bridge, so the three chat
chains become feature-equivalent instead of three partially-maintained
dispatch paths. Keeping the coding-agent and in-house agent runtimes alive
meant every bridge change had to be mirrored into two more runtimes that
had already drifted.

Historical rows are read, not migrated: sessions stored with the retired
source normalize to cli on load, workflow graphs naming the retired agents
keep loading and run on the bridge, and the visible-source check plus
SOURCE_LABELS still recognize the old value so those sessions stay listed.

The public surface follows the code: the OpenAPI generator and the MCP
chat-run tool schema drop the six retired entry fields so external callers
are not told about runtimes that no longer exist.

harness-check gains a RETIRED_RUNTIME scan so the residual check is a
mechanical gate instead of a manual grep, with the two surviving read-side
compat sites recorded with reasons.

Refs: docs/phases/phase_003.md
This commit is contained in:
2026-10-16 13:27:50 +08:00
parent c93e1fe1bd
commit 8c1ddf415f
123 changed files with 567 additions and 23599 deletions
+5 -40
View File
@@ -83,7 +83,6 @@ const tagMappings = {
'routes/webhook.ts': { name: 'Webhook', description: 'Incoming webhooks' },
'routes/auth.ts': { name: 'Auth', description: 'Authentication management' },
'routes/devices.ts': { name: 'Devices', description: 'Device pairing and LAN peer operations' },
'routes/coding-agents.ts': { name: 'Coding Agents', description: 'Coding agent installation, config, and runs' },
'routes/api-docs.ts': { name: 'API Docs', description: 'OpenAPI route catalog' },
}
@@ -213,8 +212,6 @@ function findMatchingBrace(content, openBrace) {
}
function addEndpoint(paths, method, path, controllerMethod, tagInfo, content, matchIndex, controllerSource = '') {
if (isInternalProxyRoute(path)) return
// Clean path parameters
const openapiPath = path
.replace(/:([^/]+)/g, '{$1}')
@@ -250,10 +247,6 @@ function addEndpoint(paths, method, path, controllerMethod, tagInfo, content, ma
paths[openapiPath][method] = operation
}
function isInternalProxyRoute(path) {
return path.startsWith('/api/codex-proxy/') || path.startsWith('/api/claude-code-proxy/')
}
function generateParameters(openapiPath, source) {
const params = []
const seen = new Set()
@@ -608,7 +601,7 @@ function schemaFromType(type) {
const schema = {}
if (/\bnull\b/.test(normalized)) schema.nullable = true
if (/SessionProviderApiMode|CodingAgentApiMode/.test(normalized)) {
if (/SessionProviderApiMode/.test(normalized)) {
return { ...schema, type: 'string', enum: ['chat_completions', 'codex_responses', 'anthropic_messages'] }
}
if (/string\[\]|Array<string>/.test(normalized)) {
@@ -877,13 +870,13 @@ openapi.paths['/api/chat-run/runs'] = {
},
source: {
type: 'string',
enum: ['cli', 'coding_agent', 'global_agent'],
description: 'Run backend source. Use cli for Hermes bridge runs, coding_agent for Claude Code/Codex, or global_agent for global-agent sessions. Omit source for normal Hermes chat runs; do not use the legacy api_server source.',
enum: ['cli', 'global_agent', 'workflow'],
description: 'Run backend source. Use cli for Hermes bridge runs or global_agent for global-agent sessions. Omit source for normal Hermes chat runs; do not use the legacy api_server source.',
},
session_source: {
type: 'string',
enum: ['global_agent'],
description: 'Marks a coding-agent or bridge session as launched from the global agent.',
enum: ['global_agent', 'workflow'],
description: 'Marks the session as launched from the global agent or from a workflow run.',
},
instructions: {
type: 'string',
@@ -898,34 +891,6 @@ openapi.paths['/api/chat-run/runs'] = {
type: 'string',
description: 'Optional per-run reasoning effort override.',
},
coding_agent_id: {
type: 'string',
enum: ['claude-code', 'codex'],
description: 'Coding agent id when source is coding_agent.',
},
agent_id: {
type: 'string',
enum: ['claude-code', 'codex'],
description: 'Alias for coding_agent_id.',
},
mode: {
type: 'string',
enum: ['scoped', 'global'],
description: 'Coding-agent launch mode.',
},
baseUrl: {
type: 'string',
description: 'Optional provider base URL for coding-agent runs.',
},
apiKey: {
type: 'string',
description: 'Optional provider API key for coding-agent runs.',
},
apiMode: {
type: 'string',
enum: ['chat_completions', 'codex_responses', 'anthropic_messages'],
description: 'Optional provider wire API mode for coding-agent runs.',
},
timeout_ms: {
type: 'integer',
minimum: 1,