Fix cron reminder phrasing and improve MCP tool visibility/status on long-running instances#2470
Fix cron reminder phrasing and improve MCP tool visibility/status on long-running instances#2470dsus4wang wants to merge 3 commits intosipeed:mainfrom
Conversation
- clarify that normal cron messages are replayed as user-style inputs - instruct agents to prefer first-person/direct-address wording - document recommended wording and examples in cron docs - add matching guidance to English and Chinese tool configuration docs
There was a problem hiding this comment.
Pull request overview
This PR updates cron tool and documentation guidance so that non-command cron job message values are written as user-perspective inputs (since they are replayed into the agent loop as a new user-style message when the job fires).
Changes:
- Updated the cron tool description and
messageparameter schema description to recommend first-person/direct-address wording for normal (non-command) cron jobs. - Added/expanded cron documentation guidance (including examples) about writing job messages to avoid third-person phrasing.
- Updated tool configuration docs (EN + ZH) to reflect the “message is replayed as user input” behavior and recommended wording.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/tools/cron.go | Improves LLM-facing tool prompt/schema guidance for cron message phrasing in normal jobs. |
| docs/tools_configuration.md | Adds guidance on writing cron message from the user’s perspective for non-command jobs. |
| docs/zh/tools_configuration.md | Adds the same guidance in Chinese for non-command cron job message phrasing. |
| docs/cron.md | Adds a dedicated “Writing Job Messages” section with recommended style and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | 配置项 | 类型 | 默认值 | 描述 | | ||
| |------------------------|------|--------|-------------------------------------| | ||
| | `exec_timeout_minutes` | int | 5 | 执行超时时间(分钟),0 表示无限制 | | ||
| | `allow_command` | bool | false | 允许 cron 任务执行 shell 命令 | | ||
|
|
||
| 对于不带 `command` 的普通 cron 任务,保存下来的 `message` 会在任务触发时重新作为一条新的“用户消息”送回 agent。编写时应使用用户视角/直接对 agent 说话的口吻,例如 `每小时检查仓库更新,如果有新版本告诉我`,而不是 `如果有更新就通知用户`。 |
There was a problem hiding this comment.
Pull request overview
This PR updates user-facing guidance for cron job message wording so scheduled “normal” jobs read like user prompts when replayed into the agent loop, and it also introduces MCP status plumbing surfaced via a new /list mcp command plus MCP reload re-initialization support.
Changes:
- Refine cron tool prompt/schema + docs to recommend first-person/direct-address
messagephrasing for non-commandjobs. - Add
/list mcpsubcommand and runtime callback to display MCP server status. - Rework MCP manager/tool registration to support config reloads and provide a formatted status snapshot (with added tests).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/tools/cron.go | Updates cron tool description/schema guidance for user-perspective job messages. |
| pkg/commands/runtime.go | Adds GetMCPStatus callback to command runtime dependencies. |
| pkg/commands/cmd_list.go | Adds /list mcp subcommand that replies with MCP status. |
| pkg/commands/show_list_handlers_test.go | Extends list handler tests to cover /list mcp. |
| pkg/commands/builtin_test.go | Updates /help expectations and adds test for /list mcp. |
| pkg/agent/loop.go | Initializes MCP on reload, wires command runtime to formatted MCP status, closes old MCP manager. |
| pkg/agent/loop_mcp.go | Refactors MCP runtime tracking + adds status formatting and shared MCP registration helpers. |
| pkg/agent/loop_test.go | Adds reload + status formatting tests using a fake MCP controller. |
| docs/tools_configuration.md | Documents cron message phrasing guidance for normal (non-command) jobs. |
| docs/zh/tools_configuration.md | Chinese documentation update for the same cron message guidance. |
| docs/cron.md | Expands cron guide with a “Writing Job Messages” section and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ListDefinitions: al.cmdRegistry.Definitions, | ||
| GetMCPStatus: func() string { | ||
| return formatMCPStatus(cfg, al.mcp.statusSnapshot()) | ||
| }, |
| { | ||
| Name: "mcp", | ||
| Description: "MCP server status", | ||
| Handler: func(_ context.Context, req Request, rt *Runtime) error { | ||
| if rt == nil || rt.GetMCPStatus == nil { | ||
| return req.Reply(unavailableMsg) | ||
| } | ||
| return req.Reply(rt.GetMCPStatus()) | ||
| }, |
|
Hi, the PR involves two different aspects, cron and /list mcp, maybe you mixed the two features, what is the intent of this PR? |
The first part is about cron message authoring. For normal cron jobs, the saved The second part is the MCP issue we saw in long-running processes, where MCP tools could become unavailable / not be recognized correctly after config reloads. The root cause was that reload was preserving stale MCP runtime state instead of rebuilding tool registrations from the new config. This PR fixes that by rebuilding MCP tools from the reloaded config, removing stale registrations for deleted servers, and exposing So the intent of the PR is:
I’ll update the PR description/title to make those two scopes explicit. |
|
ok clear, it would be better however to split the two functionalities into two separate PRs |
📝 Description
This PR includes two related improvements around cron authoring and MCP runtime behavior.
For normal cron jobs, the saved
messageis replayed into the agent loop as a fresh user-style input when the job fires. This updates the cron tool prompt/schema guidance so agents prefer first-person or direct-address wording such astell me,remind me, anddo not reply if nothing changed, instead of third-person wording likenotify the user. The related cron guide and both the English and Chinese tool configuration docs are updated with clearer wording and examples.This PR also fixes MCP behavior during config reload. Previously, reload could preserve stale MCP registrations from the old runtime, which meant MCP config changes were not fully applied until process restart. Reload now rebuilds MCP tools from the new config, removes tools for deleted servers, and clears stale MCP state when MCP servers are removed. In addition, a
/list mcpcommand is added so the current MCP connection/status summary can be inspected from the command layer.🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
N/A
📚 Technical Context (Skip for Docs)
payload.messageback into the agent loop as a fresh input, so third-person wording likenotify the usercan produce awkward third-person replies. Updating the cron tool guidance and docs helps the agent generate job messages in a user-facing style that produces better downstream responses./list mcpfor easier verification.🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots