Files
claw/docs/superpowers/specs/2026-04-13-lineloss-requesturl-fix.md
木炎 645dc60bae docs: add lineloss requesturl fix design spec
临时方案:在 derive_request_url_from_instruction 中添加台区线损 URL 映射

🤖 Generated with [Qoder][https://qoder.com]
2026-04-13 14:31:39 +08:00

49 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 台区线损 Skill - requesturl 快速修复方案
## 问题背景
`sgHideBrowerserOpenPage` 命令需要 `requesturl` 参数(发起调用的页面 URL但当前台区线损指令解析时返回 `about:blank`,导致浏览器不执行命令。
知乎热榜场景正常工作,因为 `derive_request_url_from_instruction` 返回了 `https://www.zhihu.com`
## 设计方案
**方案:在 `derive_request_url_from_instruction` 中添加台区线损 URL 映射**
### 修改位置
`src/service/server.rs` - `derive_request_url_from_instruction` 函数
### 修改内容
```rust
fn derive_request_url_from_instruction(instruction: &str) -> Option<String> {
// 已有:知乎相关(保持不变)
if crate::compat::workflow_executor::detect_route(instruction, None, None)
.is_some_and(|route| { ... })
{
return Some("https://www.zhihu.com".to_string());
}
// 新增:台区线损相关
// TODO: 临时方案,后续应从 skill 配置或 deterministic_submit 解析结果中获取
if instruction.contains("线损") || instruction.contains("lineloss") {
return Some("http://20.76.57.61:18080".to_string());
}
None
}
```
### 约束条件
- URL 为硬编码,后续需重构为通用方案
- 仅匹配指令中包含"线损"或"lineloss"的场景
## 后续规划
将实现通用方案:
-`DeterministicExecutionPlan.expected_domain` 构造完整 URL
- 或从 skill 配置文件中读取 target URL
- 调整流程顺序,先解析 skill 再打开 helper page