From 0ebe06048430208168d5e7c83c7e18f60977e0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E7=82=8E?= <635735027@qq.com> Date: Mon, 13 Apr 2026 15:01:23 +0800 Subject: [PATCH] docs: add lineloss target_url fix implementation plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Qoder][https://qoder.com] --- .../2026-04-13-lineloss-target-url-fix.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 docs/superpowers/plans/2026-04-13-lineloss-target-url-fix.md diff --git a/docs/superpowers/plans/2026-04-13-lineloss-target-url-fix.md b/docs/superpowers/plans/2026-04-13-lineloss-target-url-fix.md new file mode 100644 index 0000000..974704a --- /dev/null +++ b/docs/superpowers/plans/2026-04-13-lineloss-target-url-fix.md @@ -0,0 +1,76 @@ +# 台区线损 target_url 缺失修复 实现计划 + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** 在 `browser_script_skill_tool.rs` 调用 `Action::Eval` 时添加 `target_url` 参数。 + +**Architecture:** 从 `expected_domain` 构造完整 URL(`http://{expected_domain}`),添加到 invoke 的 params 中。 + +**Tech Stack:** Rust, serde_json + +--- + +### Task 1: 添加 target_url 参数 + +**Files:** +- Modify: `src/compat/browser_script_skill_tool.rs:238-241` (invoke 调用) + +- [ ] **Step 1: 修改 invoke 调用,添加 target_url** + +将: +```rust + let result = match browser_tool.invoke( + Action::Eval, + json!({ "script": wrapped_script }), + &expected_domain, + ) { +``` + +改为: +```rust + let target_url = format!("http://{}", expected_domain); + let result = match browser_tool.invoke( + Action::Eval, + json!({ + "script": wrapped_script, + "target_url": target_url, + }), + &expected_domain, + ) { +``` + +- [ ] **Step 2: 构建项目** + +Run: `cargo build` + +Expected: 编译成功,无错误 + +- [ ] **Step 3: 提交修改** + +```bash +git add src/compat/browser_script_skill_tool.rs +git commit -m "fix: add target_url param for Action::Eval in browser_script_skill_tool + +🤖 Generated with [Qoder][https://qoder.com]" +``` + +--- + +### Task 2: 端到端验证 + +**Files:** +- 无文件修改,仅运行验证 + +- [ ] **Step 1: 停止现有 sgclaw 进程** + +确保没有 `sg_claw.exe` 在运行 + +- [ ] **Step 2: 启动 sgclaw 服务** + +Run: `target\debug\sg_claw.exe --config-path ..\sgclaw_config.json service` + +- [ ] **Step 3: 在 service console 发送测试指令** + +指令: `兰州公司 台区线损大数据 月累计线损率统计分析。。。` + +Expected: 日志显示 `invoke 成功`,不再出现 `target_url is required for eval` 错误