Skip to content

chore(infra): build/deps/MCP/whitelist fixes (split 1/3 from #1057)#1059

Open
tech-synity wants to merge 7 commits into
nextlevelbuilder:devfrom
tech-synity:feat/infra-fixes
Open

chore(infra): build/deps/MCP/whitelist fixes (split 1/3 from #1057)#1059
tech-synity wants to merge 7 commits into
nextlevelbuilder:devfrom
tech-synity:feat/infra-fixes

Conversation

@tech-synity
Copy link
Copy Markdown

Summary

PR 1/3 split from #1057 per maintainer review. Channel-agnostic infrastructure fixes only — safe to merge first; PRs 2 (store + migration) and 3 (Bitrix24 channel) follow.

Commits (7)

Description
`fix(build)` Anchor pkg-helper gitignore rule to repo root
`chore` Ignore local build artifacts + Railway-exclude debug probe dirs
`chore(deps)` Bump wailsapp/wails v2.11.0 → v2.12.0
`fix(providers)` Set `additionalProperties:false` on bare object schemas in strict mode (OpenAI strict-mode compliance)
`feat(gateway)` Serve JSON index at `/` when no embedded UI (helpful for headless / API-only deployments)
`feat(mcp)` Admin-authored tool description hints via `Settings.tool_hints`
`fix(channels)` Add `bitrix24` to channel_type whitelist (+ facebook/pancake parity) — preparatory for PR 3, harmless without channel code

Why split

Maintainer review on #1057 flagged MEGA-PR risk. These commits touch unrelated infrastructure (deps, build, MCP feature, OpenAI strict mode) — independently reviewable, low risk to revert. The channel_type whitelist update is preparatory but does not require Bitrix24 code to function (just allows the type string).

Test plan

  • `go build .` passes
  • No new tests required (chore/dep/preparatory changes)
  • Maintainer to approve CI workflow run (first-time contributor PR — GitHub blocks Actions until approval)

Coordination

  • PR 2 (`feat/bitrix24-store-migration`): Bitrix24 store + migration 000058 + CLI seed command. Stacked on this branch.
  • PR 3 (`feat/bitrix24-channel-core`): Bitrix24 channel implementation, MCP integration, UI fields. Stacked on PR 2.
  • Original mega-PR feat(channels): add Bitrix24 messenger channel integration #1057 will be closed once all 3 split PRs are open.

tech-synity and others added 7 commits April 28, 2026 17:58
The bare pattern `pkg-helper` on line 6 matched any file or directory
named pkg-helper anywhere in the tree — including the tracked source
directory `cmd/pkg-helper/`. Git tolerated this because already-tracked
files override ignore rules, but uploaders that apply .gitignore patterns
naively to the filesystem (notably `railway up`) stripped the source
directory from the build context, breaking `go build ./cmd/pkg-helper`
in Docker with `stat /src/cmd/pkg-helper: directory not found`.

Anchor both binary-artifact patterns (`/openclaw-go`, `/pkg-helper`) to
the repo root so they only match the compiled output, not the source.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Working tree kept surfacing `goclaw.exe` / `goclaw-local.exe` (Windows
dev builds) and ad-hoc `tmp-reset-bot/` probe scripts as untracked.
A single `git add .` would commit them — both are useless outside the
author's machine and the debug probes import `internal/` packages from
outside `cmd/` (ugly but legal), so they should never ride into Git.

Add to .gitignore (anchored like the existing `/openclaw-go` entry, so
matching doesn't accidentally touch source dirs — same concern that
broke Docker builds in 2de99e26):

  /goclaw.exe
  /goclaw-local.exe
  /tmp-reset-bot/
  /tmp-probe*/

Also add .railwayignore file — new; Railway copies the working tree
verbatim and already ignored tests/node_modules/etc. Add `tmp-*` glob
so ad-hoc probe dirs don't bloat image layers on `railway up`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Routine dependency refresh. v2.12 pulls in a new indirect dep
(git.sr.ht/~jackmordaunt/go-toast/v2 v2.0.3 — used by Wails'
notification path) and otherwise contains only maintenance fixes
from upstream.

Verified: `go build -tags sqliteonly ./internal/... ./cmd/` green —
desktop edition's Wails bindings still compile. No goclaw code calls
the notification API directly, so the new indirect is latent unless
Wails decides to pull it into the main path later.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… in strict mode

OpenAI strict mode rejected `use_skill` calls with:
  invalid_function_parameters: 'additionalProperties' is required to be
  supplied and to be false
  at path ('properties', 'params', 'type', '0')

Root cause: applyStrictMode early-returned when a node was
`{"type":"object"}` with no nested `properties` key, leaving
additionalProperties unset. Then makeNullable widened the type to
`["object","null"]`, and the strict validator checks each branch
independently — the "object" variant was missing additionalProperties
so the whole schema failed validation.

Fix: when typ=="object", set additionalProperties:false even if the
node has no inner properties. This covers the common "bag of
free-form params" shape tool authors write as:

  params: { type: "object", description: "..." }

Trade-off worth documenting: strict mode + bare object ⇒ OpenAI will
reject any call that actually populates those params. If a tool truly
needs a free-form dict of arbitrary keys, strict mode is the wrong
fit — either declare the known keys under `properties`, or opt that
tool out of strict. Left a comment on the branch spelling this out.

Regression test added: TestApplyStrictMode_BareObjectProperty asserts
both `additionalProperties:false` AND the `["object","null"]` type
union survive the transform.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previously, builds without the `embedui` tag left "/" unhandled,
so http.ServeMux returned a bare 404 when an operator opened the
deployed URL in a browser. That's needlessly opaque — it looks
like the service is broken even though the gateway is healthy.

Register a small JSON index handler for "/" in the no-UI branch.
It returns service status + protocol version + a list of real
endpoints for an exact "/" match, and a JSON 404 for any other
unmatched path (http.ServeMux routes "/" as a catch-all).

Embedui builds are unchanged — the webui.Handler() still owns "/"
and takes precedence.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Lets admins attach server-specific quirks (e.g. "no trailing semicolons
in code args") to MCP tool descriptions without modifying the upstream
MCP server or redeploying goclaw. Hints are stored in the existing
mcp_servers.settings JSONB (no migration) following the same pattern as
require_user_credentials.

Backend:
- Add mcp.ToolHints type + ParseToolHints() helper alongside requireUserCreds
- Add BridgeTool.WithHints(global, toolHint) setter that appends a suffix
  to Description() so the LLM sees hints as part of the tool schema
- Thread hints through connectServer / connectViaPool / loop_mcp_user
- 12 new unit tests for ParseToolHints + WithHints (+ edge cases)

Frontend:
- New "AI Agent Hints (Optional)" section in MCP form dialog: a global
  textarea + a key-value list for per-tool hints
- Extend KeyValueEditor with valueAs="textarea" prop (reusable)
- Zod schema + TS types + i18n (en/vi/zh) updated

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…cake parity)

Creating a Bitrix24 channel_instance failed with "invalid channel_type"
even though Phase 03 wired the factory and the UI added Bitrix24 to the
picker. The write path hits two parallel whitelist switches — one for
WS RPC in internal/gateway/methods and one for HTTP in internal/http —
and both missed bitrix24. The WS switch also silently missed facebook
and pancake, so anything driven through the WS API was rejecting
channels the HTTP API already accepted.

- Add bitrix24 to both switches.
- Add facebook and pancake to the WS switch so the two functions stop
  drifting. CHANNEL_TYPES in the UI constants file was already offering
  both.
- Annotate each switch with a keep-in-sync comment pointing at its twin
  and at ui/web/src/constants/channels.ts. The previous drift was silent
  (untyped string list across three separate files); the comment at
  least makes the next channel addition noisy enough to catch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@chnwine
Copy link
Copy Markdown

chnwine commented May 3, 2026

want full mcp support. now mcp resource miss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants