Skip to content

Commit 4af8cb0

Browse files
LivXueclaude
andcommitted
fix(*): stop the skill block messages naming a key the write may not use
The same branch made set_skill_blocked reuse whichever spelling the config file already carries, so the key it writes is now conditional. Two lines that report what the write just did were not: the log line, and the result line of raven skill block and raven skill unblock, both named skillForge.blocklist unconditionally. On a file spelling the block skill_forge the write lands on skill_forge.blocklist while both messages say skillForge.blocklist, so an operator sent to their own config greps for a key it does not carry. Report the setting rather than the file key. That is what the sibling set_sentinel_nudge_quota already does: it respects the same two spellings and logs "sentinel nudge quota patched" with no key path at all. The --help text and the module docstring keep naming skillForge.blocklist, because they describe the command rather than the write, and that sibling names one canonical spelling in its own summary line the same way. Co-authored-by: Claude (claude-opus-5[1m]) <noreply@anthropic.com>
1 parent 0581b19 commit 4af8cb0

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

‎raven/cli/skill_commands.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def skill_block(name: str = typer.Argument(..., help="Skill name / slug to refus
140140
from raven.config.update import set_skill_blocked
141141

142142
blocklist = set_skill_blocked(name, True)
143-
console.print(f"[green]Blocked[/green] {name!r}. skillForge.blocklist = {blocklist}")
143+
console.print(f"[green]Blocked[/green] {name!r}. Skill blocklist = {blocklist}")
144144
console.print("[dim]Takes effect on the next agent/gateway start.[/dim]")
145145

146146

@@ -150,7 +150,7 @@ def skill_unblock(name: str = typer.Argument(..., help="Skill name / slug to all
150150
from raven.config.update import set_skill_blocked
151151

152152
blocklist = set_skill_blocked(name, False)
153-
console.print(f"[green]Unblocked[/green] {name!r}. skillForge.blocklist = {blocklist}")
153+
console.print(f"[green]Unblocked[/green] {name!r}. Skill blocklist = {blocklist}")
154154
console.print("[dim]Takes effect on the next agent/gateway start.[/dim]")
155155

156156

‎raven/config/update.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def _apply(_text: str | None) -> tuple[str | None, tuple[list[str], bool]]:
245245
current, wrote = atomic_update(path, _apply)
246246
if wrote:
247247
logger.info(
248-
"config/update: skillForge.blocklist now {!r} ({} {!r})",
248+
"config/update: skill blocklist now {!r} ({} {!r})",
249249
current,
250250
"blocked" if blocked else "unblocked",
251251
name,

‎tests/test_cli_skill_commands.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,26 @@ def test_skill_unblock_removes_from_config(tmp_config: Path) -> None:
210210
assert _read_blocklist(tmp_config) == ["other"]
211211

212212

213+
def test_skill_block_reports_the_block_it_wrote_on_a_snake_config(tmp_config: Path) -> None:
214+
"""The result line must not name a key this write did not use.
215+
216+
On a snake_case config the write lands on ``skill_forge.blocklist``, so a
217+
line naming ``skillForge.blocklist`` sends the operator to grep for a key
218+
their file does not carry.
219+
"""
220+
import json
221+
222+
tmp_config.write_text(json.dumps({"skill_forge": {}}), encoding="utf-8")
223+
224+
r = runner.invoke(app, ["skill", "block", "tag-memory"])
225+
226+
assert r.exit_code == 0
227+
assert "tag-memory" in r.stdout
228+
assert "skillForge" not in r.stdout
229+
data = json.loads(tmp_config.read_text(encoding="utf-8"))
230+
assert data["skill_forge"]["blocklist"] == ["tag-memory"]
231+
232+
213233
def test_skill_unblock_absent_is_noop(tmp_config: Path) -> None:
214234
r = runner.invoke(app, ["skill", "unblock", "ghost"])
215235
assert r.exit_code == 0

0 commit comments

Comments
 (0)