Repository navigation
fix(agents): accept server route tools in agent files - #680
Merged
Merged
Conversation
`agents pull` writes the server's tool_configs verbatim, including the server route tools the backend added (tool_name, route_path, method, description), but the agent file schema only knew entity and backend function tools, so every later command that reads the project failed at tool_configs[N]. Add a ServerRouteToolConfigSchema variant mirroring the backend's ServerRouteToolConfig and validated_route_path. BUG-1059 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FH6Ycrnejz2JBWgXbshcnr
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.2.2-pr.680.e01ae1ePrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.2.2-pr.680.e01ae1e"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.2.2-pr.680.e01ae1e"
}
}
Preview published to npm registry — try new features instantly! |
yardend-wix
marked this pull request as ready for review
October 25, 2026 14:56
netanelgilad
approved these changes
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Yarden Danan · Slack thread
Description
Before: Pulling an agent that has a Server route tool (
{tool_name, route_path, method, description}, added to the backend in apper #28281) writes it tobase44/agents/<name>.jsoncverbatim, but the agent file schema only knew entity and backend-function tools. Every later CLI command that reads the project refuses the file withInvalid agent file ... at tool_configs[N], soagents push,deploy, and most other project commands fail until the file is hand-edited (and removing the tool then deletes it server-side on push).After: Agent files accept server route tools. A pulled route tool round-trips into the
agents pushPUT body unchanged, andmethod/descriptionget the same defaults the server uses ("post","agent server route"). Malformed route tools are still rejected locally, with the same rules the server applies.How: Adds a
ServerRouteToolConfigSchemavariant to theToolConfigSchemaunion inpackages/cli/src/core/resources/agent/schema.ts, mirroring apper'sServerRouteToolConfig(backend/app/user_apps/app_agents/server_route_tools.py) andvalidated_route_path(backend/app/fullstack_hosting/route_path.py):tool_namematches^[A-Za-z0-9_-]{1,64}$;route_pathis trimmed, at most 2000 characters, and must fully match/(?!/)[A-Za-z0-9\-._~!$&'()*+,;=:@%/]*(single leading/, no//, backslash,?or#);methodis one ofget/post/put/patch/delete.Related Issue
BUG-1059: https://issue-tracker.base44.app/issue/BUG-1059
Type of Change
Changes Made
schema.ts: newServerRouteToolConfigSchemain the tool-config union.tests/core/agents-schema.spec.ts: route tool parse round-trip (deep-equal), defaults whenmethod/descriptionare omitted, and rejection of a badtool_name(space, >64 chars), blank ///evil.example/x/ non-relative /?query/ >2000-charroute_path, andmethod: "head".tests/cli/agents_pull.spec.ts: mocked GET returning an agent with an entity tool and a route tool →agents pull→agents push --yes; asserts the PUT body equals the GET payload.CHANGELOG.md: Unreleased › Fixed entry.No other place in the CLI enumerates tool types (type generation only uses agent names; templates and fixtures use entity tools only).
Testing
bun run typecheck- cleanbun run lint- clean (the one "info" is pre-existing on main)bun run build && bun run test(packages/cli) - 1119 passed, 19 skipped, 2 failed: both intests/cli/dev.spec.ts(Deno fallback runtime / frontend process stop), which fail identically on unmodified main in this environment (no Deno installed)Additional Notes
Possible follow-up (deliberately not in this PR): the tool variants are plain
z.object, so the CLI hard-fails on any tool type the server adds later and silently strips unknown keys from known shapes before a push. Making the variantsz.looseObject(and/or adding a final pass-through fallback to the union, leaving validation of unknown tool types to the server) would stop this class of bug recurring.🤖 Generated with Claude Code
https://claude.ai/code/session_01FH6Ycrnejz2JBWgXbshcnr