Repository navigation
Description
Cancel unmounts the create pane, but its pending submit handler still calls onCreated on success. The parent callback unconditionally switches pane to the old saved skill’s detail view. That replaces the newly opened creation form and loses its draft.
Reproduced against 44e0dcf254975286c0e9dea443b5cd1ca6b23347. Suggested severity: P2.
Reproduction
- In Settings > Skills, choose Add skill > Blank skill. Enter audit-new and a description, then click Create on a slow connection.
- While the save is pending, click the enabled Cancel button. The dialog closes.
- Open Blank skill again and type a second name and description without submitting.
- Let the first save finish.
Expected: After dismissal, completion of the old save may update the library or show a notification, but must not replace the user’s current dialog or discard a later draft.
Actual: Cancel unmounts the create pane, but its pending submit handler still calls onCreated on success. The parent callback unconditionally switches pane to the old saved skill’s detail view. That replaces the newly opened creation form and loses its draft.
Impact: A delayed completion from a dismissed operation can discard the next skill draft the operator is writing.
Evidence
The actual SkillsSettings/Create dialog pipeline accepts Cancel while a real file save is held. After a second blank draft contains second-unsaved-draft and Keep this later draft., releasing the first PUT opens audit-new detail and removes the second form. The first skill exists on disk; the second was never submitted and is absent from disk.
Executed from /tmp/tale-audit-settings-44e0dcf2:
/Users/yannick/.npm/_npx/22f2fe8d8bc13000/node_modules/.bin/bun x --no-install vitest run --config /Users/yannick/.codex/notes/tale-100-findings/agent-skills-proof/skills-batch3.vitest.config.ts --maxWorkers=1 --reporter=verbose --silent=falseObserved result: 4 passed (4), exit 0, in 27.25 seconds. Observation tests assert the current defect and controls. Frozen proof: agent-skills-proof/skills-batch3.test.tsx, config and skills-batch3.log.
Controls:
- Cancel before submission produces no PUT, closes the dialog and reopens with an empty draft.
- Ordinary creation persists the skill and opens the matching immutable slug.
- The actual library loads 20 initial rows and reveals the remaining two via its IntersectionObserver callback; description/label searches and the selected detail slug/body match native file records.
Source
Scope and deduplication
- Actual SkillsSettings, SkillCreateDialog/Pane, SkillDetailDialog/Pane, React Query, skill hooks, adapter registry and HTTP client run. A local fetch dispatcher calls the actual saveSkillForViewer/readSkillForViewer/listSkillsForViewer file functions with a fresh retained TALE_CONFIG_DIR under global notes.
- Session identity, team directory and toast sink are fixtures. The list control invokes the real infinite-scroll observer callback through a jsdom IntersectionObserver seam; browser layout and scroll geometry are not claimed.
- The finding concerns stale completion replacing current UI state. It does not claim Cancel should roll back an already submitted write. No live server, real database, provider, production, external request or browser was used.
- Searched 931 all-state issue titles and the 72-item accepted ledger for skill cancel, dismiss, pending, reopen, close and create. No matching cancellation race was found.
- Distinct from agentskill-001/bug(platform): successful skill saves can leave the editor blank until it is reopened #3642 (successful editor save blanks its own form) and agentskill-002/bug(platform): blank skill creation overwrites an existing skill when the library snapshot is stale #3643 (stale duplicate slug overwrites stored content). This replaces a subsequent unsaved create draft via a stale completion callback. Parent owns live GitHub dedup.
Independent parent verification: the full four-test batch reran successfully, exit 0. The matching live GitHub skill/cancel search returned no prior root. Parent retained log: agent-skills-proof/parent-skills-batch3.log.
Activity