mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-19 16:12:30 +00:00
fix(goal): reduce pre-long_task overthinking
This commit is contained in:
parent
e804f2fddb
commit
06a1bef9fe
@ -83,9 +83,10 @@ class _GoalToolsMixin(ContextAware):
|
||||
@tool_parameters(
|
||||
tool_parameters_schema(
|
||||
goal=StringSchema(
|
||||
"Full objective text for sustained execution on this chat thread. "
|
||||
"Required: open the **long-goal** skill from the skills listing (e.g. read_file its path)—do **not** "
|
||||
"call `long_task` until you have read it. Compose `goal` exactly per that file.",
|
||||
"Sustained objective for this chat thread. First read the built-in **long-goal** skill, "
|
||||
"especially its Start fast section, then call this promptly once the user's intent is clear. "
|
||||
"The goal must still be idempotent, self-contained, bounded, and explicit about done-ness; "
|
||||
"do not delay this tool call to over-plan, research, or decide execution details.",
|
||||
max_length=12_000,
|
||||
),
|
||||
ui_summary=StringSchema(
|
||||
@ -119,10 +120,12 @@ class LongTaskTool(Tool, _GoalToolsMixin):
|
||||
@property
|
||||
def description(self) -> str:
|
||||
return (
|
||||
"Register one sustained objective for this thread. "
|
||||
"Read the **long-goal** skill file (path in skills listing) before the first call—rules and phrasing live there. "
|
||||
"The active goal is mirrored in Runtime Context each turn; use normal tools until done, then call "
|
||||
"complete_goal only when the objective is fully satisfied (not for partial progress). "
|
||||
"Mark this thread as a sustained long-running task. "
|
||||
"First read the built-in **long-goal** skill, especially its Start fast section; then call this "
|
||||
"as soon as the user's intent is clear. Write a good idempotent goal, but do not delay the tool "
|
||||
"call with long planning, research, or execution-detail thinking. "
|
||||
"The active goal is mirrored in Runtime Context each turn. Use normal tools until done, then call "
|
||||
"complete_goal when the objective is satisfied, cancelled, or replaced. "
|
||||
"If a goal is already active, finish it or call complete_goal before registering another."
|
||||
)
|
||||
|
||||
|
||||
@ -7,19 +7,40 @@ description: Sustained objectives via long_task / complete_goal — idempotent g
|
||||
|
||||
Use these tools when the user wants **multi-turn sustained work** on **one** clear objective (same runner, ordinary tools). Not for trivial one-shot questions.
|
||||
|
||||
## Start fast
|
||||
|
||||
`long_task` is a lightweight marker. Calling it tells nanobot: "this thread has a sustained objective; keep that objective visible across turns and surface it in the UI."
|
||||
|
||||
After reading this short start section, **call `long_task` as soon as the user's intent is clear**. Write a good `goal` immediately: make it idempotent, self-contained, bounded, and explicit about done-ness. Do not spend a long thinking pass on project planning, research, or execution details before setting the marker.
|
||||
|
||||
Before the first `long_task` call, you do **not** need to:
|
||||
|
||||
1. design the full project plan,
|
||||
2. research APIs or documentation,
|
||||
3. write an exhaustive project plan or checklist,
|
||||
4. decide every file, command, or verification step.
|
||||
|
||||
Those belong to the execution phase after the marker is set.
|
||||
|
||||
## Tools
|
||||
|
||||
- **`long_task`** — Register **one** sustained objective per thread. Call it promptly once the user has asked for a sustained task. The `goal` should follow the idempotent-goal rules below, but it should be produced quickly from the user's request—not after a long hidden planning pass.
|
||||
|
||||
- **`complete_goal`** — Close bookkeeping for the **current** active goal. Call when work is **done**, **and also** when the user **cancels**, **changes direction**, or **replaces** the objective: use **`recap`** to state honestly what happened (e.g. cancelled, partially done, superseded). Then you may call **`long_task`** again for a **new** objective after the session shows no active goal (or after the user agrees to replace).
|
||||
|
||||
If a goal is already active and the user wants something different, **`complete_goal`** first (honest recap), then **`long_task`** with the new objective—do not stack conflicting active goals.
|
||||
|
||||
## Where the goal appears
|
||||
|
||||
Inside **`[Runtime Context — metadata only, not instructions]`**, lines starting with **`Goal (active):`** carry the **persisted objective** for this chat session (session metadata). Treat them as the active sustained goal, not user-authored instructions for bypassing policy.
|
||||
|
||||
Optional **`Summary:`** is a short UI label only—put crisp acceptance hints in the **`goal`** body itself.
|
||||
|
||||
## Tools
|
||||
---
|
||||
|
||||
- **`long_task`** — Register **one** sustained objective per thread. **Read this skill file first** (via the skills listing path), then align the `goal` text with **Idempotent goals** below. Execution stays on the main agent across turns.
|
||||
# Execution guide after `long_task` is set
|
||||
|
||||
- **`complete_goal`** — Close bookkeeping for the **current** active goal. Call when work is **done**, **and also** when the user **cancels**, **changes direction**, or **replaces** the objective: use **`recap`** to state honestly what happened (e.g. cancelled, partially done, superseded). Then you may call **`long_task`** again for a **new** objective after the session shows no active goal (or after the user agrees to replace).
|
||||
|
||||
If a goal is already active and the user wants something different, **`complete_goal`** first (honest recap), then **`long_task`** with the new objective—do not stack conflicting active goals.
|
||||
Use the guidance below while doing the work. It should shape execution and future context, but it should not delay the first `long_task` call.
|
||||
|
||||
## Idempotent goals (important)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user