Repository navigation
Conversation
Keep only the product rules the model cannot infer: session-scoped lifetime, no user self-service, avoiding :00/:30 for approximate times, coalesced fires, and the 7-day stale refresh. Runtime errors, tool output, and parameter descriptions already cover the rest.
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Drop details the status block, error messages, parameter schemas, or the context recovery footer already give the model at the moment they apply. Render Bash's background and timeout guidance from template variables instead of rewriting the description with string replacements that silently stop matching when the text changes.
The goal reminder injected on every active goal turn already carries the complete and blocked audits and the budget rule, and the plan mode reminder already carries the question, approval, and options rules. Keep only what those reminders do not: the plan structure, resuming a paused or blocked goal, and when to create a goal or set a budget.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9c27f800d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Schedule a prompt to be enqueued later in this session, recurring or once. `cron` is 5-field cron in the user's local time (`0 9 * * *` = 9am local). | ||
|
|
||
| Uses standard 5-field cron in the user's local timezone: minute hour day-of-month month day-of-week. `0 9 * * *` means 9am local — no timezone conversion needed. | ||
| When the requested time is approximate, avoid minute 0 and 30 so fires from many users do not land at once: "around 9" → `57 8 * * *`, "hourly" → `7 * * * *`. |
There was a problem hiding this comment.
Disclose jitter for exact-time cron schedules
For users requesting an exact recurring time—or a one-shot at :00 or :30—this guidance only addresses approximate times, so the model can schedule 0 9 * * * as if it will fire at 9:00. Jitter remains enabled by default (noJitter: false): recurring fires can shift forward by up to 15 minutes, and affected one-shots can shift earlier by up to 90 seconds (cronService.ts:131-135, jitter.ts:10-13, 48-57, 69-84). The old description disclosed these offsets; retain a brief warning so users are not promised a time the schedule may miss.
AGENTS.md reference: AGENTS.md:L119-L121
Useful? React with 👍 / 👎.
# Conflicts: # packages/agent-core-v2/test/agent/fullCompaction/fullCompaction.test.ts
commit: |
|
@codex review |
|
已由统一 PR #4521 收拢,目标分支为 release/2026-10-29;保留原分支与历史,不再单独合并此 PR。 |
Requirement or Bug
精简内置工具描述,降低每次请求的固定 prompt 开销。
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
分三个提交,每个提交一组工具,可以逐个审:
主 agent 每次请求少约 20k 字符(约 5k token)。
删减标准:
1. Cron
只改描述文本。保留的是模型推断不出来的产品规定:任务只在当前会话里存活、用户无法自己管理任务、时间说得模糊时避开 :00/:30、多次错过的触发会合并成一次、周期任务 7 天后过期。
2. Read / Bash / Agent
Bash 的描述改为用模板变量生成,不再做字符串替换:
原来的替换按 bash.md 原文精确匹配:只要改了 md 里那几句,替换就会悄悄失效,不支持后台的 agent(比如 TaskList 等工具被禁用时)会被告知可以用
run_in_background。现在改为模板变量生成;工具描述的具体文案不作为稳定测试契约。3. Plan / Goal
依据:这几个工具的长规则只在特定状态下才用得上,而在那些状态下,系统已经会注入内容相同的提醒:
goal-active-reminder.md在每个新回合都会注入(goalInjection.ts里isNewTurn时返回)。里面逐字包含完成判定、阻塞判定(包括"同一阻塞连续 3 轮")、"大多数回合不调用 UpdateGoal",以及"先检查有没有明确的预算、不要编造预算"。UpdateGoal的status参数说明里也写了阻塞规则。planModeInjection.ts),中间发简短提醒。里面包含"计划不确定时先用 AskUserQuestion"、"auto 模式下不能用 AskUserQuestion,要把决定写进 Assumptions"、"不要用文字或 AskUserQuestion 问计划行不行"、"多个方案要传options"、"用户问的是问题时直接回答"。所以工具描述里只留提醒里没有的内容。
测试改动
test/harness/snapshots.ts统一归一化:工具表只保留名称,toolsHash使用占位符;完整工具表与 hash 的对应关系仍由llmRequester.test.ts覆盖。fullCompaction.test.ts:固定 token 数改为类型断言;pre-shrink 使用 80k 窗口和大余量 fixture,额外 overhead 由测试自行注入,不再跟随内置 prompt 长度调整。bash.test.ts:删除四个直接断言工具描述文案的用例,保留后台执行、超时和权限等运行行为测试。Behavior Changes and Affected Users
受影响人群:所有主 agent 会话(TUI、print 模式、desktop 与 web、VS Code、ACP、SDK),因为工具描述随每次请求下发;能用 Bash / Read 的子 agent(coder、explore、plan、Tower worker)也受影响。Cron 和 Goal 工具只对主 agent 开放。
1. Cron
recurring: falserecurring的说明("Use false for 'remind me at X' one-shot requests with pinned minute/hour/dom/month")和cron的说明(固定日期不设 false 会每年重复)cron的说明自带*/5 * * * *示例;模型本来就会写 croncoalescedCount > 1时只按最新状态处理一次;<cron-fire>的格式stale字段说明、CronDelete「Refresh pattern」stale="true",要继续就用同样的cron和prompt重新创建stale的含义nextFireAt已经包含延迟recurring的说明Cron job cap reached、Prompt exceeds、has no fire within 5 years);prompt 上限也写在参数说明里key: value格式,一看就懂ee69d0ac29特意加的,行为不变stale的含义2. Read / Bash / Agent
Read
max_chars」「范围不完整时照Next Read续读,不要拿半页作答」kimi-file://附件那一段(存储来源、fork 后续读、二进制附件的服务端路径、ReadMediaFile 也接受)kimi-file://附件";参数path的说明已写明;二进制附件的情况由报错说明。按 #3046 的约定,Read 描述不再点名 ReadMediaFilepath的说明max_charsline_offset/n_lines翻页、负数line_offset倒着读的取舍、column_offset的边界规则line_offset写了负数用法,column_offset写了"从上一次结果里复制续读参数");越界、拆开 Unicode 字符、倒着读时带column_offset都有专门的报错wire.jsonl事件日志的方法context-recovery-footer.md)有完整的读法说明,而且只在需要时出现;读到事件日志时状态块也会提示iconv\r显示为\r<行号>\t<内容>,后面附<system>状态块,不属于文件内容」Bash
description、disable_timeout、自动通知、不要立刻等、TaskOutput只看快照、TaskStop只用来取消)BACKGROUND_GUIDANCE一段timeout的说明(前台和后台的默认值、上限都写了)human_shell_hint: The task is visible in the background-task panel.cd不保留、用cwdTIMEOUT_GUIDANCE插入,文字和原来的替换结果一致..访问工作目录之外、不要改工作目录之外的文件、不要用超级用户权限、git 写操作只在用户要求时执行&&串联有依赖的命令;独立的只读命令分开并行调用,不要用echo拼接输出;、||、管道、重定向、路径加引号、用if/for写多步逻辑which"和"GitHub 相关优先用gh"(#1296 加的)run_in_background=true;后台任务管理工具不可用」NO_BACKGROUND_GUIDANCE插入Agent
3. Plan / Goal
ExitPlanMode
options传」optionsparameter"),以及参数options的说明UpdateGoal
active:用户明确要求时恢复暂停或阻塞的 goalcomplete的判定(验证每一条要求、证据不足不算完成、不能因为预算快用完就标完成)goal-active-reminder.md的 Completion audit,逐字保留,每回合注入blocked的判定(真正的僵局、同一阻塞连续 3 轮、恢复后重新计数、目标本身不可能时当轮标记、哪些情况不算阻塞)goal-active-reminder.md的 Blocked audit,逐字保留,每回合注入;参数status的说明也有goal-active-reminder.md;描述里保留一句"不要因为做完一段工作就调用"blocked后下一条消息要解释阻塞原因」SetGoalBudget
unit的 enumGetGoal
{ "goal": null }CreateGoal
completionCriterion、objective要简洁、replace)其他可观测变化
bashAutoBackgroundOnTimeout配置和"TaskList / TaskOutput / TaskStop 任一被禁用时就不能后台运行"的判断没变,只是 Bash 描述的生成方式变了。<cron-fire>消息格式、cron 调度、参数 schema 都没变。覆盖
node用户)执行pnpm exec vitest run --maxWorkers=15:17,926 条通过、31 skipped、0 failed;908 个测试文件通过、7 skipped。agent-core-v2build / typecheck 与仓库pnpm lint通过(0 errors,既有 warnings)。agent.md后,相关 6 个测试文件 544 条通过、1 skipped,未产生快照更新。complete/blocked;options的使用是否不变。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.