Repository navigation
feat(commands): add /learn to draft skills from recent work - #100442
Conversation
/learn rewrites the turn into a standards-guided Skill Workshop authoring instruction: the agent gathers named sources (or distills the current conversation) and files ONE pending skill proposal via skill_workshop. Approval flow unchanged; sandboxed/tool-restricted agents get a clear unavailable reply. Extracts the harness OpenClaw-tools predicate into shared helpers and reserves the command name against plugin shadowing.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62c1f88fb1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const modelCompat = resolveConfiguredModelCompat({ | ||
| cfg: params.cfg, | ||
| modelProvider: params.provider, | ||
| modelId: params.model, | ||
| }); |
There was a problem hiding this comment.
Use resolved model compat for /learn availability
When the selected model comes from a plugin/runtime catalog instead of cfg.models.providers—for example Arcee trinity-large-thinking, whose catalog sets compat.supportsTools: false—resolveConfiguredModelCompat() returns undefined, so /learn is allowed even though the real run later gates tools with supportsModelTools(params.model) in src/agents/embedded-agent-runner/run/attempt.ts and sends no skill_workshop tool. In that setup the model receives an instruction to call a tool it cannot see, so users get no pending proposal instead of the intended “Skill workshop is not available” reply; this check needs to use the resolved runtime model/effective inventory compat, not only configured models.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 9:53 PM ET / 01:53 UTC. Summary PR surface: Source +268, Tests +233, Docs +21. Total +522 across 18 files. Reproducibility: yes. for the PR blocker: source inspection shows Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Land only after Do we have a high-confidence way to reproduce the issue? Yes for the PR blocker: source inspection shows Is this the best way to solve the issue? No as submitted: the thin Skill Workshop wrapper is plausible, but the best merge path must align availability with runtime model/tool compatibility, add real behavior proof, and receive maintainer approval for the core command namespace. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2db5bd3394f7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +268, Tests +233, Docs +21. Total +522 across 18 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
…#100442) * feat(commands): add /learn to draft skills from recent work (openclaw#100408) /learn rewrites the turn into a standards-guided Skill Workshop authoring instruction: the agent gathers named sources (or distills the current conversation) and files ONE pending skill proposal via skill_workshop. Approval flow unchanged; sandboxed/tool-restricted agents get a clear unavailable reply. Extracts the harness OpenClaw-tools predicate into shared helpers and reserves the command name against plugin shadowing. * docs: regenerate docs map for /learn section
What Problem This Solves
Operators repeatedly walk the agent through the same multi-step workflows, but there is no one-command path from a successful session to a saved skill. Skill authoring today starts from a blank page: you have to remember the workshop exists, describe the workflow from scratch, and know the frontmatter/structure conventions. The knowledge from a good run evaporates when the session ends.
Closes #100408.
Why This Change Was Made
/learn [request]turns "what we just did" (or named sources) into a reviewable skill draft using machinery that already exists:/goal,src/auto-reply/reply/commands-goal.ts) and lets the normal agent run execute it — no new model tool, no config surface, no system-prompt change.src/skills/workshop/learn-prompt.ts, pure function) embeds the skill-authoring standards fromdocs/tools/creating-skills.md: lowercase-hyphenatedname, one short quoted trigger-phrasedescription, no invented commands/flags, scripts as proposal support files, ~100–200-line body.skill_workshoptool./learnnever applies it — the operator approval flow is unchanged./learndefaults to distilling the reusable workflow from the current conversation.skill_workshopcannot be available. Supporting extraction: the inline "harness builds OpenClaw tools" predicate inembedded-agent-runner/run.tsmoved to shared helpers insrc/agents/harness/selection.tsso the guard reuses it instead of duplicating policy.learnis also reserved against plugin command shadowing.User Impact
/learn [request]chat command (all channels with text commands; also in the native command registry): one message converts recent work or named sources (paths, URLs, pasted notes) into a pending skill proposal, announced with proposal id and skill name.openclaw skills workshop)./learnsection in skill-workshop and the slash-command table.Evidence
src/auto-reply/reply/commands-learn.test.ts(rewrite + default + standards + 4 unavailability paths),src/skills/workshop/learn-prompt.test.ts,src/auto-reply/commands-registry.test.ts,src/plugins/commands.test.ts(reservation),src/agents/harness/selection.test.ts,src/docs/slash-commands-doc.test.ts,ui/src/pages/chat/chat-commands.test.ts, plussrc/auto-reply/reply/commands-goal.test.tsas the neighboring-precedent regression check.tsgocore + core-test lanes) and targeted oxlint clean;git diff --checkclean.feat— new/learncommand drafting reviewable skills from recent work via Skill Workshop.