Repository navigation
feat(tools): plan service tools one step at a time - #43
Merged
Merged
Conversation
Model the OpenAPI operations as an object keyed by operation, so a single operation can produce at most one tool. Before, the model could return the same operation several times under different names. - Keys are the documented METHOD URL pairs; unknown keys are rejected. - An empty selection is rejected instead of saving no tools. - Two different operations with the same tool name are rejected. - Update the contract description and the verification notes.
Replace the single model call that produced a whole tool plan with a sequence of short calls. A page gets one call per input control (for its parameter name), one for the submit control, one for the result element, and one for the tool name and description. Each OpenAPI operation gets one call that decides whether to expose it and names it. Steps run in order and stop at the first failure; there are no retries. Each answer starts with a one-sentence English "thought". The thought and the description are bounded inside their patterns: the thought is printable ASCII without double quotes or backslashes, the description has no double quotes or backslashes, and both are at most 200 characters. An unbounded string let one call generate more than 10,000 tokens, and a double quote could end the JSON string early. Also: - Result candidates exclude input and submit controls. - Every observed input control must receive a parameter name. - type="time" uses an HH:MM pattern; format "time" rejected "14:30". - planService still validates the combined plan before any tool is stored.
Twcat0503
changed the base branch from
feat/townpass-service-registry
to
main
November 7, 2026 23:30
Twcat0503
force-pushed
the
feat/townpass-step-planner
branch
from
November 7, 2026 23:30
1547315 to
47a8dd0
Compare
This was referenced Nov 7, 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.
改了什麼、為什麼
工具生成從「模型一次輸出整份計畫」改為「每次只回答一個小問題」,並修正兩個已知問題:OpenAPI 同一操作重複成兩個工具,以及
type="time"的14:30被拒絕。本機解析模型的中文能力與上下文都有限,因此拆成小步驟,每一步只提供該步需要的觀測資料。planService驗證後才組出工具。thought。thought與描述的文法限制寫在 pattern 內:不含雙引號與反斜線,且最多 200 字元。Commits(疊加在 #39 之上):
fix(tools): offer each OpenAPI operation at most once(既有)feat(tools): plan service tools one step at a time第 2 個 commit 依賴第 1 個的
apiCatalog。兩者都是工具生成的改進,因此放在同一個 PR;若維護者要求拆開,可改為兩個疊加 PR。Base 為
feat/townpass-service-registry(#39)。#39 合併後,此 PR 應改回main。如何驗證
pnpm typecheck:通過pnpm test:10 個測試檔,112 項通過,2 項略過(catalog-routes.test.ts的路由測試需要此分支沒有的 Vue router 檔案)已知限制
keyword_keyword)。service-plan.test.ts的兩項舊期望依此改寫。Checklist
pnpm typecheck/pnpm test)相關 issue(若有)
無