docs: add lineloss target_url fix implementation plan

🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
木炎
2026-04-13 15:01:23 +08:00
parent 695a888840
commit 0ebe060484

View File

@@ -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` 错误