Repository navigation
v0.3.5 — Agent 行为调优 + 索引制点击
Agent behavior tuning + index-based clicking. This release focuses on making the agent more disciplined and reliable, driven by real-world failure cases.
🇺🇸 English
New tool
page_click_by_index— Click by the index returned frompage_list_elements. Borrowed from Alibaba PageAgent's index-based design: list elements first, then click by index — no need to reverse-engineer CSS selectors. More reliable on dynamic class / AI-generated DOM.
System prompt overhaul (8 commits)
- [HIGHEST PRIORITY · Goal Anchoring] — Restate the user's original goal before every tool call. If you notice yourself changing direction (jumping pages, unrelated search, new task), STOP and ask the user. Prevents the agent from drifting off-task after hitting an obstacle (e.g. 404 → wandering into summarizing an unrelated article).
- No assumptions · surgical precision — Never fabricate selectors / URLs / attributes. Do only what was asked.
- Completeness + pre-completion verification — Execution tasks (translate all / replace / batch) must fully cover the scope. Before declaring done, verify with a tool (e.g. re-scan for residual text) — don't claim "done" based on a feeling.
- Act or state clearly · no spinning — Every reply must either call a tool or state the conclusion/obstacle in a sentence or two. No long pure-reasoning monologues. When hitting a fundamental obstacle (React/Vue re-rendering overwrites DOM edits, CSP, cross-origin), stop and tell the user — don't keep retrying an impossible direction.
- Tool list moved out of prompt — Tool schemas now go via the API
toolsparameter only, not duplicated in the prompt text. Saves ~800 tokens/turn (learned from Claude Code / OpenClaw).
Bug fixes
- Session recovery after
page_clicknavigation —navigatedByAgentflag was set but not persisted to storage bysaveSession; navigating to a PDF / new page then returning lost the session. Fixed both the flag-setting and the persistence.
🇨🇳 中文
新工具
page_click_by_index— 按page_list_elements返回的 index 点击。借鉴 Alibaba PageAgent 索引制:先列出元素,再按 index 点击,无需反推 CSS 选择器。对动态 class / AI 生成 DOM 更可靠。
System prompt 大改(8 个 commit)
- 【最高优先·目标锚定】 — 每步工具调用前默念用户原始目标。发现自己在换方向(跳页、无关搜索、转新任务)立即停下问用户。防止 agent 遇障碍后目标漂移(如 404 后跑去总结无关文章)。
- 不臆测·精准执行 — 不脑补选择器/URL/属性;只做用户要求的。
- 完整性 + 完成前验证 — 执行类任务(翻译全文/替换/批量)必须完整覆盖。宣告完成前用工具反向验证(如替换后扫残留),别凭感觉说做完了。
- 行动或明示·不空转不硬撑 — 每轮要么调工具,要么一两句明确告知结论/障碍,不要大段纯推理空转。遇根本性障碍(React/Vue 重渲染覆盖 DOM、CSP、跨域)停下问用户,不在不可能的方向硬撑。
- 工具列表移出 prompt — 工具 schema 只走 API
tools参数,不再重复进 prompt 文本。每轮省 ~800 token(借鉴 Claude Code / OpenClaw)。
Bug 修复
- page_click 导航后 session 丢失 —
navigatedByAgent标记设了但saveSession没持久化;导航到 PDF/新页面后回退丢会话。标记设置和持久化两层都修了。