feat(workspace): tell the user which workspace skills a sync skipped, and why
Issue for this PR
No GitHub issue yet.
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
When a workspace skill fails to sync, the user gets no signal. The failure is only logged, so a skill that never arrived looks the same as a workspace with no skills.
This PR makes syncSkills return which skills were skipped and a short reason for each, plus an error when the whole sync could not run: the folder is unusable or foreign, credentials can't be read, the workspace can't be confirmed, the list can't be fetched, or the publish fails. That result is then shown in two places:
- Per turn: a warning names the skipped skills — a toast in the TUI, or one line on stderr in headless
run. Each problem is shown once rather than on every retry; any clean sync (including a manual Refresh) clears that, so a problem that comes back is shown again. /workspace→ Refresh: the skipped skills are added to the existing "problems" line, capped to three plus a count. Theserverefresh report carries the fullskillsSkippedlist through to the IDE.
The reasons are fixed strings. The raw error can contain request URLs or local paths, so it stays in the log.
One case needed special handling. Offline fails at the binding lookup, before the skill list is fetched, because the binding is looked up on the network each time. It is reported there.
How did you verify your code works?
- New unit tests covering every skip reason, the "(kept the previous copy)" suffix, the rebind wording, when the warning is shown or reset, and that the route passes
skillsSkippedthrough. Each one fails when the code it covers is removed. - Workspace, skill and route suites: 1740 pass. One test fails,
flushPendingSyncs … would abandon(a 5s timeout); it fails the same way onmain. - E2E through the real
serverefresh route against a fake workspace API:- one bad bundle →
skillsSkipped: [{ skill: "bad", reason: "its file size could not be verified" }], and the good skill lands - workspace unreachable → an error is reported, and the existing skills are kept
- one bad bundle →
- E2E through headless
altimate-code run: stderr shows1 workspace skill skipped: bad: its file size could not be verified. - A read-only Codex review before opening, and the Kilo, CodeRabbit and cubic review comments. I fixed what they found, including: a foreign-folder refusal that was still silent; raw errors appearing in toasts; a failed publish hidden when a skill was also skipped; repeated toasts; no output in headless
run; a false "kept the previous ones" after a rebind; and an uncapped Refresh list. A consensus review (Claude + GPT) then led to: skill ids shown sanitised and capped; no warning when offline in a project that was never linked; local disk errors reported as such; and the warning kept even when the registry refresh fails.
Not verified: the toast rendering in the TUI.
Known gaps:
link(bind) does not read the result yet. The first turn after binding shows any problem.- In the IDE (
serve), the per-turn warning is published as a TUI toast. The extension does not show those, so IDE users see skipped skills only through Refresh (skillsSkipped). run --attachdoes not show these warnings. The turn runs on the server, which publishes a toast, but toasts do not reach an attached run's event stream, and the warning is still recorded as shown. The workspace engine's toasts have the same limitation. Fixing it means changing how workspace toasts are routed, so it belongs in its own PR.
Screenshots / recordings
Not recorded. The e2e output above shows what the Refresh report returns.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
🤖 Generated with Claude Code
Summary by CodeRabbit
- Bug Fixes
- Workspace skill synchronization now provides clearer warnings when skills are skipped or a sync fails, and can retry warnings that weren’t delivered.
- Refresh results now report skipped skills and their reasons.
- Workspace synchronization correctly respects pinned workspace settings and handles binding lookup issues.