extension-troubleshoot
GitHub诊断并修复 Piclaw 扩展错误,包括检查日志、修正导入路径、增强代码健壮性、同步骨架文件及处理权限问题。在用户确认后安全重启服务并验证状态。
Trigger Scenarios
Install
npx skills add rcarmo/piclaw --skill extension-troubleshoot -g -y
SKILL.md
Frontmatter
{
"name": "extension-troubleshoot",
"description": "Diagnose and fix piclaw extension issues (imports, DB init errors, watcher perms), update skel, and restart safely.",
"distribution": "public"
}
Extension troubleshoot
Use this when piclaw web chats only show thinking or extensions throw errors.
Steps
-
Check extension errors:
tail -n 80 /var/log/piclaw/piclaw.stderr.log -
Inspect the current extension file:
readlink -f /workspace/.pi/extensions/context-mode.ts sed -n '1,120p' /workspace/.pi/extensions/context-mode.ts -
Ensure imports reference installed Piclaw, not workspace source.
- In the container layout, use packaged sources under
/usr/local/lib/bun/install/global/node_modules/piclaw/runtime/.... - Avoid imports from
/workspace/piclawor workspace-localnode_modules; those paths can drift after reloads.
- In the container layout, use packaged sources under
-
Harden the extension.
- Remove startup cleanup that touches the DB before init.
- Wrap tool executes in
try/catch. - Guard
saveToolOutputwithtry/catch.
-
Update the matching skel extension:
cp /workspace/.pi/extensions/context-mode.ts /workspace/piclaw/skel/.pi/extensions/context-mode.ts -
Fix workspace watcher permissions if
fs.watchwarns on tailscale:sudo chown -R agent:agent /workspace/.piclaw/tailscale -
Restart Piclaw only with explicit user permission.
For an agent-driven restart, run
session_statusfirst. If another session is active, report it and wait. Otherwise send the final response, then callexit_processas the last tool action.For a manual shell restart, identify the host's active service manager and use it directly:
# Supervisor-managed container supervisorctl restart piclaw # systemd user unit, including LXC or host-native installs systemctl --user restart piclaw.service -
Verify:
tail -n 40 /var/log/piclaw/piclaw.stderr.log
Version History
- 5fa0ce5 Current 2026-07-25 10:25


