Repository navigation
Desktop: Pending review list for learned skills (ATO-67) - #1721
Draft
sosidudku1 wants to merge 2 commits into
Draft
sosidudku1 wants to merge 2 commits into
sosidudku1 wants to merge 2 commits into
Conversation
The agent now keeps a skill it learned from a turn that read outside content as a draft until the person confirms it (core PR #1696). Nadya decided on 18.11 that the desktop shows those drafts in Settings > Skills as "Pending review" with Show / Approve / Discard, so a learned skill is never saved behind the person's back. Main reads `atag skill list --json` for rows with status "pending" (an older agent without --json or without drafts gives an empty list, no error) and runs `atag skill learned show|approve|discard <id>` with argv arrays and a checked id. The renderer draws the group above the skill rows with a count, a read-only preview (the diff for an update, the draft SKILL.md for a new skill, plus its sources) and the same red confirm as Remove skill before a discard. A plain `skill list` row with status "pending" is dropped so a draft never shows as a disabled skill.
This branch has not been deployed
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.
What
Settings › Skills gets a Pending review group at the top of the skill list whenever the agent holds learned skills waiting for confirmation:
atag skill learned approve <id>and re-reads both lists (the skill is now installed);atag skill learned discard <id>.Main side (
desktop/main/skill-drafts-cli.tspure,desktop/main/skill-drafts-ipc.tswiring):skillDrafts()readsatag skill list --jsonand keeps rows withstatus: "pending"; an older agent (no--json, plain TSV, error, no pending rows) gives an empty list and no error;skillDraftShow(id)→atag skill learned show <id> --json;skillDraftApprove(id)/skillDraftDiscard(id)→ exit 0 is success, otherwise the agent's message;atagRunwith an argv array; the id is checked (/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/, no leading-) in main and in the renderer;cli:skillDrafts,cli:skillDraftShow,cli:skillDraftApprove,cli:skillDraftDiscardplus preload entries. While the app runs chats on another computer the list is empty (drafts live in that agent's state folder).A plain
skill listrow (TSV or the cloud route) with statuspendingis dropped, so a draft never shows up as a disabled skill.Logic lives in
desktop/renderer/workspace-skills.js(pure helpers and a small controller);renderer.jschanges are 9 lines. The draft list is read on entering the tab, at most every 15 s with the skills poll, and at once on Refresh.Why
Core PR #1696 (ATO-67 self-learning) saves a skill learned from a turn that read outside content (a web page, a file, a tool's output) as a draft pending the person's confirmation, so injected text cannot quietly become a standing instruction. Nadya decided on 18.11 that the desktop must show those drafts as "Pending review" with Show / Approve / Discard.
Precedent: OpenClaw skill-workshop's Learned tab (learned skills are reviewed before they join the set), and Claude Code asking the person to approve project MCP servers from
.mcp.jsonbefore they are used.Depends on core PR #1696 for
skill list --jsonpending rows andskill learned show|approve|discard. Without it the group simply never appears.Tests
desktop/test/skill-drafts.test.mjs(node:test, likeskill-eval.test.mjs): argv shapes, id validation,skill list --jsonparsing (pending only, dedupe, bad ids, older agent's TSV),learned show --jsonparsing, the plain-list filter, grouping and count, HTML escaping of the reason / skill name / preview / sources, the Discard confirm, the controller (show, approve, discard only after confirm, throttle, failures, no bridge), and wiring pins for preload, IPC, main, the CLI filter and the Skills tab.Verification (the MBP run must check)
npm run build && npm run test:unit(the new test needsout/main/skill-drafts-cli.js), tsc and lint clean.--json): no group, no error banner, the skill list as before.Not yet checked on the second Mac.