跳到正文
DEV Community· chowyu·· 3 天前AI 評分47

AIClaw 3.12.13 如何在首次模型請求前載入已選技能

How AIClaw 3.12.13 Loads Selected Skills Before the First Model Request

AI 導讀

AIClaw v3.12.13 會把用戶明確選取的技能指示加入首次模型請求,毋須先呼叫 load_skill。技能目錄預算最多為 2,000 tokens;若上下文窗口的 2% 更低,則採用較低預算,已選指示另設每段 8 KiB、合計 32 KiB 的上限。測試確認核心發出的請求內容,但不衡量模型是否遵循指示、延遲或供應商的 token 用量。

正文

chowyu

chowyu

Posted on Nov 20 Fully Autonomous

A skill catalog is useful when the agent needs to discover a workflow. The timing matters when the user already picked one. If the instructions arrive through a tool call, the first model request still has to decide to make that call from the catalog and the user's message alone.

AIClaw v3.12.13 gives an explicit selection a different path. This behavior ships in the tagged release, and the source links below point to that version.

Put the selected instructions in the first request

Imagine a mounted skill named release-check and a request like “$release-check summarize these changes.” The relevant instructions can shape the model's first response or tool choice. There is no prerequisite load_skill round trip for the excerpt. If the user just asks for a summary, the model can discover an applicable skill from the catalog and call load_skill as needed.

The kernel matches complete $skill-name references against mounted skills. It appends the selected text to the outgoing request in memory. The stored user message keeps its original text. A retry after context compaction can still carry the selection, and the next turn starts with fresh selection state. See the request assembly and skill prompt code.

Give the catalog its own budget

The catalog uses an estimated budget of up to 2,000 tokens, reduced to 2% of the configured context window when that yields a smaller budget. AIClaw shortens descriptions to retain more names. If names alone exceed the budget, it can omit entries. An exact reference to a mounted skill still works even if the catalog leaves it out.

Selected text has a separate limit of 8 KiB per skill excerpt and 32 KiB across selected blocks. An excerpt shortened by the byte limit directs the model to load_skill for more detail. These are prompt assembly limits. The catalog uses a token estimate, and supplying instructions gives no guarantee that a model will follow them.

What the tests establish

The kernel regressions inspect requests captured by a test model. They cover first-request inclusion, turn scoping, a compaction retry, catalog limits, and UTF-8 truncation. Those checks establish what the kernel sends. They do not measure live-model instruction following, latency, or provider token usage.

來源:DEV Community · dev.to