From ec6a3f660c78abcd0f54ac999520b4b41abe241d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeffry=20W=C3=BCrmli?= Date: Mon, 23 Nov 2026 17:19:05 +0100 Subject: [PATCH 1/2] fix: keep the chat language in every sub-command and across compaction (YOU-45) Only the primary flow printed the resolved chat language, so `all` and the other sub-commands depended on the model remembering the rule: identical `all --auto-merge` starts came out German in one session and English in the next. read-config, which every invocation runs, now ends with a CHAT_LANGUAGE_TODO reminder; `all` prints the line first and names the language in the worker and reviewer briefing. A stateless SessionStart hook (matcher compact) reminds the model of the last printed language after a compaction, whose summary is English and not a user message. The SKILL.md line budget rises 400 to 410 for the new Language table. --- .claude-plugin/marketplace.json | 2 +- .claude-plugin/plugin.json | 2 +- CHANGELOG.md | 16 +++++++++ README.md | 3 +- SPEC.md | 11 ++++-- docs/troubleshooting.md | 2 ++ docs/usage.md | 2 +- hooks/hooks.json | 12 ++++++- hooks/remind-chat-language | 22 ++++++++++++ skills/youtrack-task/SKILL.md | 13 +++++-- skills/youtrack-task/reference/batch.md | 11 ++++-- skills/youtrack-task/scripts/read-config | 5 +++ tests/README.md | 9 +++-- tests/read-config.sh | 5 +++ tests/remind-chat-language.sh | 44 ++++++++++++++++++++++++ tests/skill-text.sh | 17 +++++++-- 16 files changed, 161 insertions(+), 15 deletions(-) create mode 100755 hooks/remind-chat-language create mode 100644 tests/remind-chat-language.sh diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index fd6419a..7986694 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -8,7 +8,7 @@ { "name": "youtrack-task", "description": "Create or pick up a JetBrains YouTrack issue from any repo: branch, move to In Progress, plan, ship a PR, and write everything back to the issue.", - "version": "0.21.0", + "version": "0.21.1", "source": "./", "author": { "name": "Jeffry Wuermli" diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index b923998..a26a033 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "youtrack-task", "description": "Create or pick up a JetBrains YouTrack issue from any repo: branch, move to In Progress, plan, ship a PR, and write everything back to the issue.", - "version": "0.21.0", + "version": "0.21.1", "author": { "name": "Jeffry Wuermli" }, diff --git a/CHANGELOG.md b/CHANGELOG.md index 669a302..5607279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,22 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.21.1 — 2026-11-23 + +- **Fix: the chat language held in the primary flow only.** In `all --auto-merge` runs the + language was German in one session and English in the next, with the same invocation: only + the primary flow printed `→ Chat language:`, so `all` and the other sub-commands depended on + the model remembering the rule. Now `read-config` (step 0, run on every invocation) ends with + a `CHAT_LANGUAGE_TODO=` reminder, `all` prints the line as its first output and names the + language in the worker and reviewer briefing, and the other sub-commands print it right + after step 0. +- **Fix: the language fell back to English after a compaction.** The compaction summary is + English and says nothing about the chat language. A new `SessionStart` hook with matcher + `compact` (`hooks/remind-chat-language`) reminds the agent of the last printed language and to + relay notices from hooks and plugins such as claude-mem in it. Text claude-mem writes itself + is not under the plugin's control. +- `SKILL.md` line budget 400 → 410 for the Language table. New `tests/remind-chat-language.sh`. + ## 0.21.0 — 2026-11-22 - **The config file creates and maintains itself.** A `SessionStart` hook (`hooks/sync-config`) diff --git a/README.md b/README.md index 66b7c85..3bc2d06 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,8 @@ On pickup the plugin: > [!IMPORTANT] > Nothing is pushed until you run `pr`, and it asks first. Branch names, commits and > PR text are always English; YouTrack comments follow the issue's language. Chat -> replies keep your session's language, or follow the issue's in a fresh session. +> replies keep your session's language, or follow the issue's in a fresh session, +> in every sub-command including `all`, and across a compaction. --- diff --git a/SPEC.md b/SPEC.md index 738077d..614d21e 100644 --- a/SPEC.md +++ b/SPEC.md @@ -32,8 +32,9 @@ youtrack-task/ │ └── marketplace.json # so `/plugin marketplace add JtheGunner/youtrack-task` works ├── .mcp.json # YouTrack HTTP MCP server, values from env vars ├── hooks/ -│ ├── hooks.json # SessionStart (startup): sync-config; PreToolUse: YouTrack `create_issue`; Bash, Edit, Write, MultiEdit from `all` subagents (timeout 10 s) +│ ├── hooks.json # SessionStart (startup): sync-config, (compact): remind-chat-language; PreToolUse: YouTrack `create_issue`; Bash, Edit, Write, MultiEdit from `all` subagents (timeout 10 s) │ ├── sync-config # once per plugin version: create config.toml from config.example.toml, or add new options (commented) and remove obsolete ones +│ ├── remind-chat-language # after a compaction: reminds the model of the chat language (stateless) │ ├── require-assignee # rejects a create_issue without Assignee (Claude Code only) │ ├── guard-subagent # confines ticket-worker / ticket-reviewer (push, merge, read-only; worker file writes only inside its worktree) │ └── require-review # opt-in (review_gate_hook): no push / gh pr create of an issue branch without a review stamp @@ -117,7 +118,13 @@ an earlier user message precedes the invocation (`CLAUDE.md`, memory and hook te do not count) → the issue's language (for `new`, the input text; mixed or unclear: the language the user writes in). It is resolved once and printed as `→ Chat language: ()` at the top of the step-2 brief, so later -replies follow a visible value instead of the model's habit. +replies follow a visible value instead of the model's habit. The line is printed in +every invocation: `read-config` (step 0, which always runs) ends with a +`CHAT_LANGUAGE_TODO=` reminder, the primary flow prints it in step 2, `all` and the +other sub-commands right after step 0. `all` names the language in the worker and +reviewer briefing. A compaction summary is not a user message: a `SessionStart` hook +with matcher `compact` (`hooks/remind-chat-language`, stateless) reminds the model of +the last printed language and to relay hook and plugin notices in it. ### Nothing instance-specific in the repo diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index bf80c74..c94a257 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -73,6 +73,8 @@ Find your symptom, apply the fix. Back to the [README](../README.md). | The review ends `BLOCKED` / the reviewer reports `blocked-by-guard`, or says build, lint or CI could not be checked | The reviewer needed a command that is not on its allowlist (for example `swift build` with flags, a `ddev` wrapper, a project script). That is missing proof, not a code finding, so no fix round is spent. Allow the exact command: add it to `.youtrack-task/reviewer-commands` in the repo (merge it into the base branch first, a branch cannot allow itself) or to `reviewer_commands` in your config, then run the review again. Or waive on purpose with `pr --no-review`. Details: [Letting the reviewer run more](configuration.md#letting-the-reviewer-run-more). | | A worker command or file write is rejected by the hook | Working as intended: workers never push or merge, use no network tools and write only inside their worktree; the main session pushes after review. Needs `jq`; if you see no guard at all, check that the plugin (not just the skill) is installed and up to date. | +| The chat switches to English in an `all` run or after a compaction | Fixed in 0.21.1. Before, only the primary flow printed `→ Chat language:`, so `all` depended on the model's habit, and the English compaction summary pulled short replies to English. Now every invocation prints the line, and a `SessionStart` hook (`hooks/remind-chat-language`) reminds the agent after a compaction. Limit: text that claude-mem itself writes is not under the plugin's control; the agent is told to relay it in the chat language. | + ## 🧩 Other agents | Symptom | Fix | diff --git a/docs/usage.md b/docs/usage.md index ae77956..7d9b20e 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -194,7 +194,7 @@ cd ~/projects/admin-dashboard-vue && claude |--------|----------| | Branch names, commit messages, PR title and body | Always English, even for a German issue. | | YouTrack comments and the title/description of issues created by `new` | The issue's language. Your own "English everywhere" rules for code and docs don't override this. | -| What the agent says to you in the chat | Your instruction if you gave one. Otherwise the session's language if you had already written to the agent before the invocation, else the issue's language. The brief starts with `→ Chat language: ()`. | +| What the agent says to you in the chat | Your instruction if you gave one. Otherwise the session's language if you had already written to the agent before the invocation, else the issue's language. Every invocation prints `→ Chat language: ()` first: before the brief in the primary flow, straight after loading the config in `all` and every other sub-command. Workers and reviewers in `all` are told the language too, and after a compaction a `SessionStart` hook reminds the agent of it. | --- diff --git a/hooks/hooks.json b/hooks/hooks.json index 564f66f..27a000f 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -1,5 +1,5 @@ { - "description": "Once per plugin version, creates ~/.config/youtrack-task/config.toml from config.example.toml or syncs it (adds new options commented out, removes obsolete ones). Guards direct YouTrack create_issue calls (an Assignee must always be set, text in the user's language), confines the `all` sub-command's worker and reviewer subagents (no pushes or merges, read-only reviewer, worker file writes only inside its worktree), and — only when review_gate_hook is on — blocks pushing or opening a PR for an issue branch without a review stamp.", + "description": "After a compaction, reminds the model of the chat language (the summary is English and not a user message). Once per plugin version, creates ~/.config/youtrack-task/config.toml from config.example.toml or syncs it (adds new options commented out, removes obsolete ones). Guards direct YouTrack create_issue calls (an Assignee must always be set, text in the user's language), confines the `all` sub-command's worker and reviewer subagents (no pushes or merges, read-only reviewer, worker file writes only inside its worktree), and — only when review_gate_hook is on — blocks pushing or opening a PR for an issue branch without a review stamp.", "hooks": { "SessionStart": [ { @@ -11,6 +11,16 @@ "timeout": 10 } ] + }, + { + "matcher": "compact", + "hooks": [ + { + "type": "command", + "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/remind-chat-language\"", + "timeout": 10 + } + ] } ], "PreToolUse": [ diff --git a/hooks/remind-chat-language b/hooks/remind-chat-language new file mode 100755 index 0000000..39a8f63 --- /dev/null +++ b/hooks/remind-chat-language @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# SessionStart hook (matcher: compact): after a compaction, remind the model which +# language the chat is in. +# +# The compaction summary is written in English and carries no language marker, so +# without a reminder short replies drift back to English. The hook keeps no state: +# the language was printed in the conversation as `→ Chat language: …` (SKILL.md +# "Language"), and this text only points at it. Whatever the hook prints on stdout +# is added to the session context. +# +# It never fails a session and has no effect on sessions that did not use +# /youtrack-task (the text says so). +set -u + +cat <<'EOF' +youtrack-task reminder (the conversation was just compacted): +If /youtrack-task ran in this session, keep replying in the language of its last printed `→ Chat language:` line, or in the language the user writes to you if there is none. +The compaction summary is not a user message, and the language it is written in is not the chat language. +Notices from hooks and plugins (for example claude-mem) are not user messages either: relay them in the chat language, do not switch to theirs. +Git artifacts stay English; YouTrack-side text follows the user's / the issue's language. +EOF +exit 0 diff --git a/skills/youtrack-task/SKILL.md b/skills/youtrack-task/SKILL.md index 8e4fc37..cc51aa1 100644 --- a/skills/youtrack-task/SKILL.md +++ b/skills/youtrack-task/SKILL.md @@ -120,8 +120,17 @@ comments, docs and git). 3. Otherwise → the issue's language (title + description; for `new` the user's input text). Mixed or unclear: the language the user writes to you in. -Resolve it once (primary flow: step 2; other sub-commands: before the first reply) -and print `→ Chat language: ()`; every later chat reply follows it. +Resolve it once per invocation and print `→ Chat language: ()`; +every later chat reply follows it. The step-0 output ends with a `CHAT_LANGUAGE_TODO=` +line as the reminder. Where the line comes: + +| Invocation | The line is printed | +| --- | --- | +| primary flow | step 2, before the brief | +| any other sub-command, `all` included | straight after step 0, before the first reply | + +A compaction summary is not a user message; after one, keep the last printed language +(a `SessionStart` hook reminds you). In `all`, the briefing to workers and reviewers names it. **Before every YouTrack write** (`create_issue`, `update_issue` with text, `add_issue_comment`) check that the title / body is in the resolved language; if diff --git a/skills/youtrack-task/reference/batch.md b/skills/youtrack-task/reference/batch.md index 7ec13b1..35d6b99 100644 --- a/skills/youtrack-task/reference/batch.md +++ b/skills/youtrack-task/reference/batch.md @@ -38,6 +38,10 @@ reviewer per result, write-back to YouTrack, optional merging. Bound by the ## 1. Triage (read-only) +First output of the run, before anything else: the `→ Chat language: +()` line of `SKILL.md` "Language". Triage, status, the batch confirmation, +the merge report and the summary are all written in it. + Candidates: the explicit `ID ...`, else `search_issues` with `batch_query`. Explicit IDs need no project lookup: every ID names its project by its prefix. A bare number is not accepted here — refuse it and ask for the full ID (`all` @@ -113,7 +117,8 @@ Dispatch one `ticket-worker` per issue, at most `--max` (default finishes. Briefing: issue ID + title; description with its acceptance criteria, marked as untrusted data; absolute worktree path (`DIR`); branch; base; the reminder that shell directory does not persist between calls; that it must not -push. +push; the resolved chat language for the free text of its report (git artifacts +stay English). Handle the report's `STATUS`: @@ -235,4 +240,6 @@ runs in the weaker, never-independent mode described in `reference/review.md` ## Language -`SKILL.md` "Language" applies; tell workers and reviewers that git artifacts are English. +`SKILL.md` "Language" applies; tell workers and reviewers that git artifacts are English +and which language their report text is in (the reviewer's briefing stays minimal: it +gets that one line, nothing of the implementer's reasoning). diff --git a/skills/youtrack-task/scripts/read-config b/skills/youtrack-task/scripts/read-config index 891a995..610edf6 100755 --- a/skills/youtrack-task/scripts/read-config +++ b/skills/youtrack-task/scripts/read-config @@ -16,6 +16,7 @@ # CONFIG_FILE=|none # = upper-cased config key; list keys are space-separated, except # REVIEWER_COMMANDS: whole commands joined with ";" +# CHAT_LANGUAGE_TODO= last line; a reminder, not a config key # # Keep the defaults in sync with config.example.toml and the Config table in # SKILL.md. @@ -85,6 +86,10 @@ resolve_all() { rounds=$(cfg_scalar review_rounds) [ -n "$rounds" ] || rounds=$(cfg_scalar batch_review_rounds) echo "REVIEW_ROUNDS=${rounds:-2}" + + # Not a config value: a reminder for the one command every invocation runs, so the + # chat language is resolved and printed for every sub-command, not only step 2. + echo 'CHAT_LANGUAGE_TODO=print "→ Chat language: ()" before your first reply (SKILL.md "Language")' } all=$(resolve_all) diff --git a/tests/README.md b/tests/README.md index b57d836..dd15bdd 100644 --- a/tests/README.md +++ b/tests/README.md @@ -132,7 +132,7 @@ Use a throwaway or low-stakes issue. | 75 | more than 20 matching tickets, `all --dry-run` | `search_issues` is called repeatedly with `offset` 0, 20, … until a short page; all tickets are in the table | | 76 | no candidate is *ready*, `all` | the table is printed and the run stops; no question such as "should I run X instead?" | | 77 | `tests/setup-workspace.sh` | every case prints `ok`, ends with `ALL OK`; exit 0 (a base that exists only locally is the start point in place, in a linked worktree and in a new worktree, even when HEAD is another branch; `origin/` beats a diverged local ``; an unresolvable base gives `ERROR=cannot-resolve-base` (exit 2) with no branch or worktree created; a custom `worktree_dir` is created and resumed) | -| 78 | `shellcheck -S warning hooks/guard-subagent hooks/require-review hooks/require-assignee hooks/sync-config skills/youtrack-task/scripts/*` | no output, exit 0 (intentional exceptions carry a `# shellcheck disable=… # reason` comment) | +| 78 | `shellcheck -S warning hooks/guard-subagent hooks/require-review hooks/require-assignee hooks/sync-config hooks/remind-chat-language skills/youtrack-task/scripts/*` | no output, exit 0 (intentional exceptions carry a `# shellcheck disable=… # reason` comment) | | 79 | open a PR against `main` | the `ci` workflow runs `tests/*.sh`, ShellCheck, `jq empty` on all JSON files and the plugin/marketplace version check; all green | | 80 | bump only `plugin.json` (not `marketplace.json`) and push | the `ci` job fails on the version-consistency step | | 81 | push a `v*` tag whose version differs from either manifest, or with a failing `ci` | the release workflow stops before building the ZIP | @@ -183,4 +183,9 @@ Use a throwaway or low-stakes issue. | 126 | install the plugin with no `~/.config/youtrack-task/config.toml`, restart Claude Code | one line at session start says the config was created; the file has every option, commented out, with its comment | | 127 | after 126, edit one value, then update to a version that adds an option and drops another, restart | one line names the added and removed options; the new option is appended commented, the dropped one is gone, your edited value and own comments are intact, `config.toml.bak` holds the old file; a second restart prints nothing | | 128 | make `~/.config/youtrack-task` read-only, install or update, restart | a warning *"could not update …"* appears and the session works normally; after fixing the permissions the next start syncs | -| 129 | `jq empty hooks/hooks.json`, then inspect it | a `SessionStart` entry with matcher `startup` runs `hooks/sync-config`, `timeout: 10` | +| 129 | `jq empty hooks/hooks.json`, then inspect it | a `SessionStart` entry with matcher `startup` runs `hooks/sync-config`, `timeout: 10`; one with matcher `compact` runs `hooks/remind-chat-language` | +| 130 | fresh session, German issue, `/youtrack-task all --auto-merge` (run it several times) | every run starts with `→ Chat language: German (issue)`; triage, status, batch confirmation and summary are German each time | +| 131 | same, but you wrote in English before the invocation | `→ Chat language: English (session)`; everything English | +| 132 | `/youtrack-task done ` (or `comment`, `testing`, `pr`) in a fresh session with a German issue | the first reply is preceded by `→ Chat language: German (issue)` | +| 133 | in a German `all` run, let the context compact (`/compact`), then continue | replies after the compaction stay German, including short status lines and relayed claude-mem notices | +| 134 | `tests/remind-chat-language.sh`, `tests/read-config.sh`, `tests/skill-text.sh` | every case prints `ok`; exit 0 (reminder text, `compact` matcher, `CHAT_LANGUAGE_TODO` line, table row for the other sub-commands, `batch.md` line and worker briefing) | diff --git a/tests/read-config.sh b/tests/read-config.sh index a0ac764..e964443 100755 --- a/tests/read-config.sh +++ b/tests/read-config.sh @@ -26,6 +26,11 @@ expect "missing file -> worktree auto" "WORKTREE=auto" expect "missing file -> clone default" "WORKTREE_CLONE=node_modules vendor" expect "missing file -> review rounds 2" "REVIEW_ROUNDS=2" expect "missing file -> batch_query not state-bound" "BATCH_QUERY=for: me #Unresolved sort by: updated desc" +if printf '%s\n' "$out" | grep -qE '^CHAT_LANGUAGE_TODO=.*→ Chat language:'; then echo "ok output carries the chat-language reminder line" +else echo "FAIL output carries no CHAT_LANGUAGE_TODO reminder"; fail=1; fi +single=$(YOUTRACK_TASK_CONFIG=$tmp/missing.toml bash "$script" worktree 2>&1) +[ "$single" = "auto" ] && echo "ok single-key mode ignores the reminder line" \ + || { echo "FAIL single-key mode printed '$single', want 'auto'"; fail=1; } cat > "$tmp/user.toml" <<'EOF' # comment diff --git a/tests/remind-chat-language.sh b/tests/remind-chat-language.sh new file mode 100644 index 0000000..a1c81d0 --- /dev/null +++ b/tests/remind-chat-language.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Cases for hooks/remind-chat-language. +# Usage: tests/remind-chat-language.sh [path-to-hook] +# Prints one line per case and exits non-zero if any case differs from the +# expectation. +set -u +root=$(cd "$(dirname "$0")/.." && pwd) +hook=${1:-$root/hooks/remind-chat-language} +fail=0 + +ok() { echo "ok $1"; } +bad() { echo "FAIL $1"; [ $# -gt 1 ] && printf '%s\n' "$2" | sed 's/^/ | /'; fail=1; } + +[ -x "$hook" ] && ok "hook is executable" || bad "hook is missing or not executable: $hook" + +out=$(bash "$hook" &1) +status=$? +[ "$status" = 0 ] && ok "exits 0" || bad "exit status $status, want 0" "$out" + +printf '%s' "$out" | grep -qF '→ Chat language:' \ + && ok "points at the printed '→ Chat language:' line" \ + || bad "reminder does not mention the '→ Chat language:' line" "$out" +printf '%s' "$out" | grep -qiE 'not a user message' \ + && ok "says the compaction summary is not a user message" \ + || bad "reminder does not say the summary is not a user message" "$out" +printf '%s' "$out" | grep -qiE 'claude-mem|plugin' \ + && ok "covers notices relayed from hooks and plugins" \ + || bad "reminder does not cover relayed hook / plugin notices" "$out" +printf '%s' "$out" | grep -qF '/youtrack-task' \ + && ok "scoped to sessions that used /youtrack-task" \ + || bad "reminder is not scoped to /youtrack-task sessions" "$out" + +# hooks.json registers it for SessionStart on compaction only. +reg=$(sed -n '/"SessionStart"/,/"PreToolUse"/p' "$root/hooks/hooks.json") +printf '%s' "$reg" | grep -qF 'remind-chat-language' \ + && ok "hooks.json registers remind-chat-language under SessionStart" \ + || bad "hooks.json does not register remind-chat-language under SessionStart" +compact=$(printf '%s' "$reg" | grep -B4 'remind-chat-language' | grep -F '"matcher"') +printf '%s' "$compact" | grep -qF '"compact"' \ + && ok "remind-chat-language runs on the compact matcher only" \ + || bad "remind-chat-language is not bound to the compact matcher" "$compact" + +[ "$fail" = 0 ] && echo "ALL OK" || echo "FAILURES" +exit "$fail" diff --git a/tests/skill-text.sh b/tests/skill-text.sh index a20a4d7..9ea643a 100755 --- a/tests/skill-text.sh +++ b/tests/skill-text.sh @@ -71,7 +71,7 @@ done # 6. SKILL.md stays small and loads only what the invocation needs. # The target is about 350 lines; the Guardrails, Language, Config table and the # primary flow have to stay whole, so there is a little headroom. -max_lines=400 +max_lines=410 lines=$(wc -l < "$skill/SKILL.md" | tr -d ' ') [ "$lines" -le "$max_lines" ] && ok "SKILL.md has $lines lines (max $max_lines)" \ || bad "SKILL.md has $lines lines, max $max_lines" @@ -267,9 +267,22 @@ printf '%s' "$langsec" | grep -qF '**Chat replies**' \ printf '%s' "$step2" | grep -qF '→ Chat language:' \ && ok "step 2 prints the '→ Chat language:' line" \ || bad "step 2 does not print the '→ Chat language:' line" -chatcopies=$(grep -rniE 'chat language|chat replies' "$skill/reference" || true) +chatcopies=$(grep -rniE 'chat replies' "$skill/reference" || true) [ -z "$chatcopies" ] && ok "chat-language rule is defined only in SKILL.md" \ || bad "chat-language rule is restated in a reference file" "$chatcopies" +# 11. Every invocation resolves the chat language, not only the primary flow (YOU-45). +printf '%s' "$langsec" | grep -qF 'CHAT_LANGUAGE_TODO' \ + && printf '%s' "$langsec" | grep -qiE 'any other sub-command' \ + && ok "Language section names the step-0 reminder and the line for every other sub-command" \ + || bad "Language section has no table row for the other sub-commands / no CHAT_LANGUAGE_TODO" +grep -qF '→ Chat language:' "$skill/reference/batch.md" \ + && ok "batch.md prints the '→ Chat language:' line first" \ + || bad "batch.md does not print the '→ Chat language:' line" +workerbrief=$(sed -n '/^## 3\. Work/,/^Handle the report/p' "$skill/reference/batch.md") +printf '%s' "$workerbrief" | grep -qiE 'language' \ + && ok "worker briefing names the reply language" \ + || bad "worker briefing does not name the reply language" + [ "$fail" = 0 ] && echo "ALL OK" || echo "FAILURES" exit "$fail" From af340f59c6e4170cc1bcf18e128415ab9f67da6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeffry=20W=C3=BCrmli?= Date: Mon, 23 Nov 2026 17:19:54 +0100 Subject: [PATCH 2/2] docs: keep the new troubleshooting row inside the Hooks table (YOU-45) --- docs/troubleshooting.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index c94a257..72cd27a 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -72,7 +72,6 @@ Find your symptom, apply the fix. Back to the [README](../README.md). | A reviewer command is rejected by the hook (e.g. a Gradle task) | The reviewer is read-only and runs an allowlist. Gradle is allowed for check tasks by exact name only (`test`, `check`, `lint`, `detekt`, `ktlintCheck`, `spotlessCheck`, `lint(Debug\|Release\|Vital\|VitalRelease)`, `testUnitTest`, optionally with a `:module:` path) and the options `--no-daemon`, `--offline`, `--tests `, `-x ` and a few logging flags. Build, publish and clean tasks, `-D` / `-P`, `-I` / `-b` / `-c`, and globs in option values are denied. Task abbreviations such as `lintF` are denied on purpose (Gradle would expand them to `lintFix`). Needs plugin 0.15.4 or newer. | | The review ends `BLOCKED` / the reviewer reports `blocked-by-guard`, or says build, lint or CI could not be checked | The reviewer needed a command that is not on its allowlist (for example `swift build` with flags, a `ddev` wrapper, a project script). That is missing proof, not a code finding, so no fix round is spent. Allow the exact command: add it to `.youtrack-task/reviewer-commands` in the repo (merge it into the base branch first, a branch cannot allow itself) or to `reviewer_commands` in your config, then run the review again. Or waive on purpose with `pr --no-review`. Details: [Letting the reviewer run more](configuration.md#letting-the-reviewer-run-more). | | A worker command or file write is rejected by the hook | Working as intended: workers never push or merge, use no network tools and write only inside their worktree; the main session pushes after review. Needs `jq`; if you see no guard at all, check that the plugin (not just the skill) is installed and up to date. | - | The chat switches to English in an `all` run or after a compaction | Fixed in 0.21.1. Before, only the primary flow printed `→ Chat language:`, so `all` depended on the model's habit, and the English compaction summary pulled short replies to English. Now every invocation prints the line, and a `SessionStart` hook (`hooks/remind-chat-language`) reminds the agent after a compaction. Limit: text that claude-mem itself writes is not under the plugin's control; the agent is told to relay it in the chat language. | ## 🧩 Other agents