feat(ui): route chat deploy intent through the template catalog - #281
Open
zjy365 wants to merge 1 commit into
Open
feat(ui): route chat deploy intent through the template catalog#281zjy365 wants to merge 1 commit into
zjy365 wants to merge 1 commit into
Conversation
The Assistant had no way to discover the 215 curated Sealos templates: it could emit a `template` source but not learn a valid `templateName`, and the system prompt said nothing about choosing a Deployment Source. Asked to deploy GLPI — which ships a curated template — it invented a Docker image instead. Add `searchDeployCatalog`, shaped like `loadSkill` (ranked index query, detail on demand) and backed by the already-cached `listTemplateCatalog`. It degrades to a tool-level error when the provider is unreachable so the turn survives. Give the system prompt an explicit source-preference order and forbid inventing an image name. Unblock GitHub deployment from chat, and let a GitHub task exist without a Deployment Credential Binding (ADR-0062). The runner already treated the token as optional everywhere; only one throw required it. An unbound task clones a public repository anonymously and deploys an already-published image, which is the common case. Creation fast-fails a repository GitHub positively refuses, and fails open on rate limits. The managed gateway prompt tells the agent it cannot push, so an unsupported source build fails at detection rather than after the image is built. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
zjy365
force-pushed
the
feat/chat-deploy-intent-routing
branch
from
August 20, 2026 08:22
9570510 to
2d52672
Compare
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.
Asked to "部署 glpi", the Assistant invented a Docker image instead of using the curated GLPI template that already exists in the Sealos catalog.
Three causes, all engineering:
createDeployTaskaccepts atemplatesource but nothing let the model learn a validtemplateName, so it fell back to the one source it could fully specify from its own knowledge.CHAT_BASE_SYSTEM_PROMPTcovered AP/DB/Project/bash and said nothing about choosing a Deployment Source.Changes
Catalog discovery — new
searchDeployCatalog, shaped likeloadSkill(ranked index query, detail on demand), backed by the already-cachedlistTemplateCatalog. Returns the exacttemplateNameplus required args. Returns a tool-level error instead of throwing when the provider is unreachable, so the turn degrades to apromptsource rather than dying.Routing prompt — explicit source preference: template → github → prompt → docker, with docker only when the user names an image. Requires asking the user for a template's required args instead of inventing secrets (GLPI needs
admin_password).Unbound GitHub tasks (ADR-0062) — chat can now create GitHub tasks, and a task no longer requires a Deployment Credential Binding. The runner already treated the token as optional at every use site; a single
throwrequired it. An unbound task clones a public repo anonymously and deploys an already-published image.Two guards keep that honest:
404, or403with budget left). It fails open on rate limits — anonymous GitHub reads are 60/hr per egress IP, so inability to ask must not block a deploy.github-credential-requiredrather than attempt a push — turning a failure that used to land after a full image build into one at detection time.Verification
bun typecheckandbun checkclean.chat-deploy-catalog-tool.test.tschat-deploy-task-tool.test.tsrepo-public-access.test.tsrunner-credential-binding.test.tsgateway-prompt.test.tsdeploy-tasks/route.test.tsengine/engine.test.tsRanking also validated against the live 215-template catalog:
glpi,GLPI helpdesk, and the repo URL all rank theglpitemplate first and surfaceadmin_password.wikicorrectly returns nothing (no wiki template exists), falling through to the github/prompt path.Two route tests changed meaning rather than breaking: they encoded the old "connection required" rule and now assert unbound creation plus private-repo rejection.
Notes for review
github-credential-requiredis the signal. If most need a source build, the answer is lowering GitHub-connect friction, not more unbound work.🤖 Generated with Claude Code