Skip to content

feat(qwencode): author skills kill-switches and accept numeric-string hook timeouts - #3370

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2668
Oct 9, 2026
Merged

dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2668

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Two follow-ups for the Qwen Code target from #2668.

1. Skills kill-switches (skills.* in .qwen/settings.json)

Qwen Code reads skills.disabled, skills.defaultDisabled, skills.enabled and skills.disabledLevels from both the project and the user settings.json (settings reference, QwenLM/qwen-code#4533, #7357, #8057). Until now rulesync had no way to author them. It is also the only way to turn off a bundled or extension skill that rulesync does not generate.

  • QwencodePermissionsOverrideSchema gains a skills loose object, next to tools and security.
  • qwencode-permissions.ts adds a third override group, skills, with the curated import list QWEN_OVERRIDE_SKILLS_KEYS and the scope rules QWEN_SCOPED_SKILLS_KEYS. Each group is shallow-merged into the existing skills object, so an unrelated sibling such as skills.directories is preserved. On import the four keys are lifted back into qwencode.skills.
  • "skills" is added to the .qwen/settings.json permissions ownedKeys in the shared-config gateway. When the override has no skills block, an existing skills block in the file is left unchanged (covered by a test).
  • Docs: the qwencode permissions blockquote in docs/reference/file-formats.md, the TSDoc on the schema, and the research reference (.rulesync/skills/rulesync-feature-research/references/qwencode.md).

2. Numeric-string hook timeout on import

Upstream hook-timeout.ts (v0.25.0) coerces a numeric-string timeout such as "60000" with Number(). rulesync's QwencodeHookEntrySchema accepted only numbers. Because of that, an imported .qwen/settings.json with a string timeout failed safeParse, and the entire matcher group, including every sibling hook, was silently dropped. Import now:

  • accepts a numeric string and reads it as the number it spells, before the existing legacy millisecond rule ("60000" becomes 60 s);
  • drops a non-numeric or empty string, which matches Qwen Code falling back to the hook's default timeout;
  • keeps the rest of the group.

Generate is unchanged, because the canonical timeout is always a number.

Design decisions (made autonomously)

  • The skills kill-switches go through the permissions override, not a new skills-feature writer. This follows the precedent of Factory Droid's disabledSkills permissions override and reuses the existing scope gate and import machinery.
  • Exactly four keys are imported: disabled, defaultDisabled, enabled and disabledLevels. skills.directories is a discovery path, not a kill-switch, so it stays in settings.json and is not lifted on import. It can still be authored through the loose object, and is then announced as an unmodeled key.
  • Scope rule: global-machine-wide for all four. None of them is on WORKSPACE_RESTRICTED_SETTINGS, WORKSPACE_NON_OVERRIDING_SETTINGS or WORKSPACE_TIGHTEN_ONLY_SETTINGS at v0.25.0. Their notes are specific to each key, not the autonomy wording. Qwen Code unions each list across scopes (mergeStrategy: UNION in settingsSchema.ts), but the override replaces the list in the file it writes. The notes say so, and skills.enabled is described as the granting direction.
  • The timeout coercion applies to every hook type, since upstream also Number()s http, prompt and function timeouts. Only command hooks then go through the legacy millisecond threshold, as before.

Not done here (still open on #2668)

  • general.outputStyle / .qwen/output-styles/: this needs a general settings group in the override (a wide UI and behaviour bag) plus a trust-affecting warning path. That is a larger design change than this PR.
  • .qwen/workflows/: the file contract is still documented only in the bundled workflow-creator skill.
  • Fork profiles (.qwen/fork-profiles/*.md): these are frontmatter-only and Qwen Code rejects a body, so they do not map onto rulesync subagents (see the feat: add Qwen Code checks, MCP allow/deny lists and by-product gitignore entries #3275 note).
  • tools.codeModeOnly: still undocumented upstream.

No rules-processor.ts convention or gitignore change is needed. No new output paths are added.

Refs #2668

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj

… hook timeouts

Add a skills group to the qwencode permissions override so skills.disabled, defaultDisabled, enabled and disabledLevels in .qwen/settings.json can be authored and round-trip on import. Accept a numeric-string hook timeout on import instead of silently dropping its whole matcher group.

Refs #2668

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
# Conflicts:
#	src/generated/docs-content.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant