Skip to content

Fix three self-hosted code mode bugs (i18n hint, Test button, codeMode write path) - #1445

Merged
helpcodeai merged 3 commits into
mainfrom
helpcodeai/code-mode-selfhosted-fixes
Nov 2, 2026
Merged

helpcodeai merged 3 commits into
mainfrom
helpcodeai/code-mode-selfhosted-fixes

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Closes #1444. Three bugs found while enabling code mode on a self-hosted instance. No schema change; off by default everywhere (unchanged until an operator runs the code-runner and a workspace sets codeMode).

Changes

  1. i18n hint — toolEditor.codeUsesHint in messages/{en,de,it}.json held a literal JSON example with { } braces and <id>; next-intl/ICU parsed { as a placeholder and <id> as a tag, threw, and fell back to the raw key (Next dev overlay showed "1 Issue"). Reworded the hint in words — no braces, no angle brackets.
  2. Test button — POST /api/connectors/:id/tools/:toolId/test called executeConnectorCall (REST/engine path, no method:'code' branch), so a code tool HTTP-called the connector base URL and failed. Now routes code tools to DynamicMcpTools.runSavedCodeTool, the real out-of-process runner path, with the same governance (uses allow-list, read/write, invoker/definer). No mcpServerId is passed (owner testing their own tool, like an operator call).
  3. codeMode write path — codeMode was missing from the MCP server DTO and the UI, so it could only be set in the DB. Added codeMode to UpdateMcpServerDto (@IsIn(['off','tools','inline'])) + the service, a select on the server settings page, and a shared CODE_MODE_MODES constant.

Cloud vs self-hosted

Same on both; no behaviour change until the runner is configured and a server's codeMode is turned on. These are usability fixes for the admin flow, most relevant to self-hosted.

Testing (worktree, after npm ci + prisma generate)

  • packages/backend: npx tsc --noEmit clean; eslint clean on changed files; jest on the touched areas — tools.controller / secret-guard / dynamic-mcp-tools(.code) / kg-skill (211 pass) and mcp-servers + license (265 pass).
  • packages/frontend: npx tsc --noEmit clean; eslint clean on changed files.
  • Verified all code-mode i18n keys parse under intl-messageformat in en/de/it.
  • node scripts/generate-llms-txt.mjs --check clean after a docs note.

Reviewed every line.

- i18n: reword the code-uses hint so ICU stops falling back to its key
  (literal { } braces and <id> tags broke next-intl formatting)
- Test button: route saved code tools to the out-of-process runner with
  the same governance, instead of the REST engine that HTTP-called the
  connector base URL and failed
- codeMode write path: add it to the MCP server update DTO + service and a
  select on the server settings page, so admins no longer need raw SQL
@helpcodeai
helpcodeai merged commit d6d32c5 into main Nov 2, 2026
14 checks passed
@helpcodeai
helpcodeai deleted the helpcodeai/code-mode-selfhosted-fixes branch November 2, 2026 11:48
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code mode: three self-hosted usability bugs (i18n hint, Test button, codeMode write path)

1 participant