Repository navigation
feat(v0.19): skills lifecycle, follow-up chaining, multilingual picker search & woken-turn reliability - #141
Merged
Conversation
…icker search, and woken-turn reliability Problem: - Users could list, run, and scaffold skills, but could not inspect a skill's triggers/workflow (`/skills show`) or edit workspace skills in `$EDITOR` (`/skills edit`), and `dsh` `Alt+S` picker filtering missed multilingual `triggers:` because `Picker` searched only `label` and `detail`. - Creating a skill in chat required typing `/s:<name>` afterwards, and skills had no declarative way to offer follow-up skill buttons on completed chat answers. - Four background-job / woken-turn gaps remained in `PLAN.md`: woken answers during `sessions.flush()` could be swallowed by `activeTurns` (or miss unmapped first-turn `liveKeyOf`), `maxKeptAgents` could silently dispose an already-woken finishing reply, a `jobs` service reload/unload left stale subscriptions, and terminal `busy(key)` undercounted while a kept agent waited for a woken turn. Changes: - Extended `core/skills.ts` with `next:` YAML frontmatter parsing (comment- and quote-aware YAML scalar/list parsing, >48-char slug rejection, self-loop exclusion), `followUpSkillButtons()`, `formatSkillDetail()` (symlink-safe, bounded read, zero host-path leakage), enriched `createSkillScaffold()` with optional `triggers`/`inputHint`/`next` & commented hints, and `clearSkillsCache()`. - Wired `/skills show <name>` across `core/commands.ts`, `index.ts` (with `withoutHome()` scrubbing and one-click `▶ <slug>` button), and `tui/cli.ts`, plus TUI `/skills edit <name>` (`tui/app.ts` `createIfMissing: false` guard + unconditional cache invalidation), chat `/skills new` one-click run button, and declarative `next:` follow-up buttons (`↪ <slug>`) resolved via direct `findSkill()` after explicit and auto-matched skill turns. - Added `PickerRow.keywords` in `tui/picker.ts` and passed skill `triggers:` from `tui/cli.ts` so `Alt+S` / `/skills` filters across Korean/English/Chinese triggers without cluttering visible rows. - Fixed the 4 background-job / woken-turn reliability bugs in `core/harness.ts` and `index.ts`: `summarizeTurn(session, firstSeq, endSeq)` isolation + releasing `activeTurns` before `sessions.flush()` with `activeTurns` guards on `streamForwarder`/`questionAnswerer` and `liveKeyOf` fallback in `deliveryWatcher`; `draining` flag + cap exemption/promotion in `keepForJobs` and `releaseWhenDone` (with `releasingKept` re-entrancy guard); `watchJobs()` reload/unload re-subscription and kept-agent sweep; and accurate `busy(key)` excluding quiet turns in `liveOrigins`, `runningTurns`, and `waiting`. - Added hermetic cross-platform suite `test/v19-skills-lifecycle-and-woken.test.ts`, wired CI (Ubuntu + Windows), added real-model acceptance scenario `test/scenarios/auto-skills.json`, and updated `PLAN.md`, `CHANGELOG.md`, and `docs/setup.md` (removing stale `Open` bullets already fixed in v0.6/v0.12). Verified: - Independent adversarial review completed and all 12 findings fixed. - Full local gate (`pnpm run build && pnpm run typecheck && pnpm test`) passed (`EXIT=0`), including `test/v19-skills-lifecycle-and-woken.test.ts` (43/43), `test/core.test.ts` (673/673), `test/v18-natural-skills-ux.test.ts`, and `test/secrets.test.ts`. - Real-model scenario `node test/run-scenario.ts test/scenarios/auto-skills.json` passed 1/1 in an isolated test home with zero tool calls. Unverified: - Live mobile Slack/Discord/Telegram rendering of `↪ <slug>` follow-up buttons and interactive TTY `$EDITOR` spawning for `/skills edit` were verified via fakes/unit tests rather than live mobile clients or a manual TTY editor. Signed-off-by: rlaope <rlaope@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
core/skills.ts,core/commands.ts,index.ts,tui/cli.ts,tui/app.ts):/skills show <name>across chat (withwithoutHome()scrubbing + one-click▶ <slug>button) anddshTUI card (formatSkillDetail(), symlink-safe & bounded, tenant-safe)./skills edit <name>launching$EDITORon workspace skills (createIfMissing: falsesafety, refuses read-only global skills, unconditionalclearSkillsCache()).createSkillScaffold()with optionaltriggers/inputHint/nextmetadata & commented YAML hints, and attached a one-click▶ <slug>button on chat/skills new <name>replies.next:YAML frontmatter skill chaining (followUpSkillButtons()): explicit and auto-matched chat skill turns attach up to 3 validated, in-scope↪ <slug>follow-up buttons resolved via directfindSkill().Alt+S//skillspicker search (tui/picker.ts,tui/cli.ts):PickerRow.keywordsso typing Korean/English/Chinese triggers (브리핑,회의록,주간,리서치) inAlt+Smatches skills immediately without cluttering visible rows.core/harness.ts,index.ts,PLAN.md):summarizeTurn(session, firstSeq, endSeq)+ releasingactiveTurnsbeforesessions.flush()(withactiveTurnsguards onstreamForwarder/questionAnswererandliveKeyOffallback indeliveryWatcher) so woken answers during flush are delivered without leaking streams or merging into the original turn.drainingflag + cap exemption/promotion inkeepForJobs/releaseWhenDone(plusreleasingKeptre-entrancy guard) somaxKeptAgentsnever silently disposes an already-woken finishing reply or lets draining agents starve real jobs.watchJobs()reload/unload re-subscription and kept-agent sweep.busy(key)during kept-agent woken waits while excluding quiet turns acrossliveOrigins,runningTurns, andwaiting.PLAN.mdOpenentries already resolved in v0.6/v0.12.Verification
master..HEADand all 12 findings were fixed.pnpm run build && pnpm run typecheck && pnpm test) passed (EXIT=0), includingtest/v19-skills-lifecycle-and-woken.test.ts(43/43),test/core.test.ts(673/673), andtest/secrets.test.ts.node test/run-scenario.ts test/scenarios/auto-skills.jsonpassed 1/1 in an isolated test home with zero tool calls.Unverified
↪ <slug>follow-up buttons and manual TTY$EDITORspawning for/skills editwere verified via fakes/unit tests rather than live mobile clients or a manual TTY editor.