Repository navigation
Conversation
render skills list panics with a nil pointer dereference in tui.(*StackModel).Push when run with --output text, json or yaml, or without a TTY, which falls back to text. The command always pushes its TUI view onto the stack from the context, and the root command only puts a stack in the context in interactive mode. The test runs render skills list through the root command with no TTY and with each non-interactive format. It fails on this commit with the same panic as the issue. To run the command without reading the real home directory, the command is now built by newSkillsListCmd, which takes the function that loads skills state. The skills state path is fixed when the package loads, and tool detection reads the home directory, so setting HOME in a test can't isolate either. Building a fresh command per test also keeps flag values from carrying over between tests, as they do on a package-level command. Behavior is unchanged. Refs render-oss#79
render skills list pushed its TUI view onto the stack from the context on every run. Outside interactive mode (--output text, json or yaml, or any run without a TTY) the root command puts no stack in the context, so the push dereferenced a nil *StackModel and panicked. Route non-interactive output through command.NonInteractive, as skills install already does, and only push the view in interactive mode. - JSON and YAML print skills.ListResult: the installed skills with their version and scope (filtered by --scope), the tools recorded in the state file with whether each is detected and its skills directory, the install time and any warnings. Keys are camelCase like the CLI's other JSON output, empty lists print as [] rather than null, and a version of "unknown" is left out. - Text prints a skills table and a tools table in the same table style as other list commands' text output, using "-" for empty cells. - Warnings from reading installed skills also go to stderr, styled like other warnings there, so text output shows them without mixing them into the tables. The output type lives in pkg/skills next to InstallResult, and the table rendering in pkg/text next to the other tables. The --scope filter moves into skills.FilterSkillsByScope, which both the new output and the interactive view use, so the two can't disagree about which skills are at a scope. The view is otherwise unchanged. Fixes render-oss#79
gorban
force-pushed
the
fix-skills-list-noninteractive
branch
from
December 3, 2026 20:46
13b5a2a to
cc6bdff
Compare
render skills list panic with text, json and yaml outputBuild the command with newSkillsRemoveCmd, as skills list does, so tests run it through the root command with a fresh command each time. The no-TTY harness moves into executeSkillsCommand, shared with the skills list tests. Behavior is unchanged. The test runs render skills remove without --all or --skill, with no TTY and with -o text and -o json. It fails with the same nil pointer panic as skills list did, from pushing the TUI view when there is no stack. Refs render-oss#79
Without --all or --skill, render skills remove opens a prompt to choose skills. Outside interactive mode (--output text, json or yaml, or no TTY) there is no TUI stack, and pushing the view onto it panicked. Return an error naming the flags instead, in the form other commands use for required non-interactive input. Fixes render-oss#79
This was referenced Dec 3, 2026
…e mode Make `skills update` a constructor like `list` and `remove` so tests can run it. Behavior is unchanged. The new tests cover: - `skills update` and bare `render skills` without a TTY or with -o text or json, which still panic. - `skills list -o json --scope project`, which reports each tool's user skills folder rather than the project one. - Warnings, which `skills list -o json` prints to stderr as well as into the output. - Interactive mode, where `skills list` still opens its view. The test helper now uses a temporary HOME, so tool detection never reads the real one, and returns a panic as an error so it fails only the test that caused it. The remove test uses `--tool claude`, as in the issue. Refs render-oss#79
Outside interactive mode (no TTY, or -o text, json or yaml): - `skills update` returns "`render skills update` can only be used in interactive mode", the error other interactive-only commands use, instead of panicking. - Bare `render skills` prints its help instead of panicking. - `skills list -o json --scope project` reports each tool's skills folder in the current repository, and leaves it out outside one. - `skills list` prints warnings to stderr only for text; JSON and YAML carry them in the output. `skills remove` uses command.IsInteractive, like the commands above. Fixes render-oss#79
Author
|
Thanks for picking this up! 1e3db3e and 02c8745 cover everything this PR fixed ( |
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
render skills list,render skills update, barerender skills, andrender skills removewithout--allor--skillpanicked with--output text,jsonoryaml, and on any run without a TTY (which falls back to text). Each pushed a TUI view onto the stack from the context, and outside interactive mode there is no stack, soPushran on a nil*StackModel. Running in a terminal doesn't avoid it:-o textis enough.Non-interactive output now goes through
command.NonInteractive, asskills installalready does. Interactive mode is unchanged.skills.ListResult(inpkg/skills/list.go, next toInstallResult): installed skills with version and scope, filtered by--scope; the tools recorded in state with whether each is detected and its skills folder (in the current repository for--scope project, and left out outside one); the install time; and any warnings. Keys are camelCase. (skills install -o jsonprints Go field names such asSkillsDiranddry_run; changing that would break existing scripts, so it's left alone here.) Empty lists print as[], and theunknownversion placeholder is left out.text.SkillTables(inpkg/text, like the other list tables), with-for empty cells. With nothing installed it prints just the headers, as other tables do; the interactive view keeps its "Run render skills install" hint.warningsonly, so stdout and stderr stay clean for scripts.skills removewithout--allor--skillneeds the prompt to choose skills, so outside interactive mode it now returns--all or --skill is required in non-interactive mode, the formpsqlandsshuse for required non-interactive input. With either flag it works as before.skills updatereturns`render skills update` can only be used in interactive mode, the error other interactive-only commands use. A non-interactive update changes files, so it should be designed on its own.render skillsprints its help, listing the subcommands, instead of opening the command palette. Like--help, it prints help text even with-o json.--scopefilter moves intoskills.FilterSkillsByScope, used by both the new output and the interactive view, so they can't disagree. The view is otherwise unchanged.Motivation
Fixes #79. Seen in v2.35.0 and v2.40.0 on linux/amd64.
How to verify
The commits are red then green, in three pairs:
newSkillsListCmd(loadState)(no behavior change) so tests can supply skills state, and runsrender skills listthrough the root command with no TTY and with each-oformat. On this commit it fails with the panic from the issue; the panic stops the test binary at the first subtest.--scopefiltering, YAML, the empty state, warnings on stderr, a load error,FilterSkillsByScopeandSkillTables.newSkillsRemoveCmd()(no behavior change) and runs it without--allor--skill: no TTY,-o text,-o json, and--confirm --tool claude --scope user -o text, as in the issue. It fails with the same panic. The no-TTY harness is shared with the list tests asexecuteSkillsCommand.skills updateand barerender skillsoutside interactive mode, the project skills folder inskills list -o json --scope project(in a new git repository and outside one), and warnings staying out of stderr for JSON. It also checks that interactive mode still opens the list view.skills updatebecomes a constructor like the others (no behavior change). The harness returns a panic as an error, so each crashing case fails on its own.The tests never read the real skills state. Its path is fixed when the package loads, so the list tests supply the state through
newSkillsListCmd(loadState), and theremoveandupdatetests stop at their argument checks.HOME(andUSERPROFILE) point at a temporary directory, so tool detection doesn't read the real home either. A fresh command per test keeps flag values from carrying over.Checked with Go 1.27.4:
go test ./cmd/ ./pkg/...passes (as a non-root user),gofmt,go vetandgo mod tidyare clean, and golangci-lint v2.14.0 with--new-from-revagainstmainreports 0 issues.This overlaps with #82 in
cmd/skillsremove.go. I suggest landing this one first; #82 then carries its--toolhelp text intonewSkillsRemoveCmd, and changesNewListResultto find tools saved asCursor.Release notes