test(cli): read the inspect answer through the spill policy

The shipped Web composition now puts four Schedule tools on every live root
Agent, which pushes a full-preset `cordis_inspect_query` answer past the
12,500-token inline budget, so the spill policy retains its head and tail with
a spill path instead of the complete JSON.
This commit is contained in:
Chinesezjc committed 2026-09-24 16:41:20 +08:00
1 parent 5c768e3c8a
commit 015c187e67
4 files changed
+12 -6

No files matched your search

@@ -18,5 +18,5 @@
en: ca032a407c2ee8cb
zh: 748a4fcf2485a3da
/agent-note-schedule-in-the-shipped-web-composition/consequences:
en: 1f90fdd84e5c7817
zh: cf3319ac1238502c
en: 4f23bda8fda37987
zh: 9f7c4a3538bd2979
@@ -35,4 +35,5 @@ A Web scenario that drives a live step now logs one time-context reading per ste
- Every Web session's request header carries four additional tool schemas, and every eligible step appends one durable user message. A conversation that never creates a reminder pays that token cost.
- The clock reading is model-visible and durable, so it replays, compacts, and appears in exported Session logs like any other user message.
- A deployment that wants the previous behavior disables the `time-context`, `schedule`, and `ui-schedule` rows in its own profile patch layer; the capability itself is untouched.
- The `cordis_inspect_query` `listTools` answer for a full preset table now passes the base composition's 12,500-token inline budget, so the spill policy retains that answer's head and tail with a spill path instead of the complete JSON.
- The repository preview image and both Web suites drop their overlay arguments, so one composition change reaches every surface at once.
@@ -35,4 +35,5 @@ Status: implemented
- 每个 Web 会话的请求头多出四个工具 schema,且每个符合条件的步骤追加一条持久 user 消息。从不创建提醒的对话也要承担这份 token 成本。
- 时钟读数对模型可见且持久,因此它与其他 user 消息一样参与回放、压缩,并出现在导出的 Session 日志中。
- 想要恢复旧行为的部署,可在自己的 profile patch 层禁用 `time-context`、`schedule` 与 `ui-schedule` 三行;能力本身没有改动。
- 完整预设表的 `cordis_inspect_query` `listTools` 答案现在超过基础组合 12,500 token 的内联预算,因此 spill 策略改为保留该答案的首尾并给出 spill 路径,而不是完整 JSON。
- 仓库预览镜像与两个 Web 测试套件都不再传 overlay 参数,一处组合改动即同时作用于所有界面。
+8 -4
View File
@@ -685,10 +685,14 @@ describe('a user preset declared from the shipped cordis rows', () => {
agent: copied.agent,
})
expect(queried.isError).toBe(false)
const tools = (JSON.parse(resultText(queried)) as { data: { tools: Array<{ name: string }> } }).data.tools
expect(tools.map(tool => tool.name)).toEqual(expect.arrayContaining([
'bash', 'cordis_inspect_list', 'cordis_inspect_query', 'plugin_manager',
]))
// The whole-table answer can pass the inline token budget once the
// preset's tool table grows, and the spill policy then replaces its
// middle with a gap plus a spill footer. What this case proves is the
// provider's answer, so assert the names it must carry.
const queriedText = resultText(queried)
for (const toolName of ['bash', 'cordis_inspect_list', 'cordis_inspect_query', 'plugin_manager']) {
expect(queriedText).toContain(`"name": "${toolName}"`)
}
// The `Config` provider reads the booted profile tree: the shipped `tools` row declares a Config,
// and the bootstrap include row is a carrier. The name filter keeps each page small.