fix(view): sync command skills, memory, and grok detection#288
Conversation
…ction from config symlink (#187)
Code ReviewerVerdict: Changes requested Build: Clean ( Operating instructions read: Changes that work wellBug A2 ( Bug B (
Collision detection in Issue that needs attentionOrphan sweep deletes command skills in full-sync modeFile: const trustedSkills = new Set(skillsToSync); // ← missing command namesIn a no-selection (full) sync, when a source skill at Concrete path that triggers this:
Same path fires on Why the existing tests miss this: both A1 tests use explicit selections ( Fix (one line): // versions.ts:1873 — include command-as-skill names in the trusted set
const trustedSkills = new Set([
...skillsToSync,
...(commandsAsSkills ? commandsToSync : []),
]);This ensures that names the commands writer just wrote into Things to verify manuallyThe PTY E2E in the PR description uses Reviewed by Code Reviewer — actually ran the build and tests on this branch. |
Closes #187.
Summary
SyncResult/ writer result shape was wrong: writers still return{ synced: string[] },syncResourcesToVersionmaps that intoresult.commands, and the view reporter reads the existing keys.memoryis absent.home/.grok/downloads) instead of the host~/.grokconfig symlink.Root Causes
installCommandSkillToVersiontreated every same-name source skill as a hard skip, so colliding command names produced an empty writer result and stale command-skill files were never refreshed.syncResourcesToVersionnow keeps generated command skills authoritative for command-as-skill agents while leaving genuine skills alone.skipMemorytreatedselection.memory === undefinedas an explicit exclusion, so view-sync partial selections skipped rules even when the agent was rules-capable andAGENTS.mdwas missing.~/.grok/downloads; after config symlink switching, that path could point at a version home with no binary.Verification
bun test src/lib/staleness/writers/commands.test.ts-> 2 passed, 0 failed.bun test src/lib/versions.test.ts-> 8 passed, 0 failed.bun run build-> exit 0. The build script printed the existing non-fatalcp: bin/Agents CLI.app: No such file or directoryfrom the guarded macOS app-copy branch.bun run test-> 189 test files passed, 3 skipped; 2364 tests passed, 51 skipped.HOME,dist/index.js view grok, host.groksymlink pointed at empty0.2.32, binary placed only in0.2.33/home/.grok/downloads. Output includedGrok (available), acceptedSync new resources? Yes, sync all new, and reportedSynced to Grok@0.2.33: commands, memory. Filesystem checks confirmed the per-version binary still existed,skills/debug/SKILL.mdcontained fresh command body +agents_command: "debug", and.grok/AGENTS.mdcontained the composed memory body.