From be395afa40f625840d5296c3eca2a203b832748d Mon Sep 17 00:00:00 2001 From: Vardhman Gupta Date: Mon, 12 Oct 2026 10:37:42 +0530 Subject: [PATCH 1/3] feat(setup): add zero-token /magpie-status Claude Code mod command (part of #1497) Implement Pilot 2 of Issue #1497: add zero-token /magpie-status slash command in plugins/magpie-setup using Claude Code's mod system. - Register /magpie-status during session.start hook with immediate: true. - Hook command.run on magpie-status to execute canonical collect_status.py deterministically via $.process.run with zero tokens and zero model turns. - Support default markdown table format and --format json / --format=json / --json flag overrides. - Try python3 first, falling back cleanly to python on command-not-found or process failure, with actionable diagnostic error text. - Pass PYTHONIOENCODING: utf-8 and defensively wrap stdout reconfiguration in collect_status.py to guarantee safe unicode output across all platforms. - Add 10 comprehensive unit and engine tests in status-command.test.ts. - Normalize path separators in drift-check.test.ts for cross-platform mock matching on Windows, macOS, and Linux. - Update docs/when-to-use-mods.md and status/SKILL.md to document the new command while preserving universal /magpie-setup status skill for non-Claude harnesses. Generated-by: Antigravity --- docs/when-to-use-mods.md | 2 +- .../magpie-setup/hooks/drift-check.test.ts | 34 ++- plugins/magpie-setup/hooks/drift-check.ts | 42 ++- .../magpie-setup/hooks/status-command.test.ts | 258 ++++++++++++++++++ plugins/magpie-setup/hooks/status-command.ts | 101 +++++++ plugins/magpie-setup/skills/status/SKILL.md | 5 +- .../skills/status/scripts/collect_status.py | 6 + 7 files changed, 430 insertions(+), 18 deletions(-) create mode 100644 plugins/magpie-setup/hooks/status-command.test.ts create mode 100644 plugins/magpie-setup/hooks/status-command.ts diff --git a/docs/when-to-use-mods.md b/docs/when-to-use-mods.md index b43c1c2cd..262f8c086 100644 --- a/docs/when-to-use-mods.md +++ b/docs/when-to-use-mods.md @@ -147,7 +147,7 @@ The following table summarizes candidate opportunities for additive mods across | Skill Family | Candidate Mod Enhancement | Fallback Behaviour (Without Mod) | |---|---|---| -| **`family:setup`** | Instant lockfile drift notification on `session.start`; zero-token `/magpie-status` command; GPG hardware touch toast. | Skill pre-flight step performs comparison in prompt context; standard CLI status output. | +| **`family:setup`** | Instant lockfile drift notification on `session.start` (Pilot 1); zero-token `/magpie-status` command (Pilot 2); GPG hardware touch toast. | Skill pre-flight step performs comparison in prompt context; standard CLI status output. | | **`family:utilities`** | Zero-token `/magpie-skills` command; live token-usage band during skill authoring and evals. | Standard skill execution via model turn. | | **`family:security`** | Deterministic pre-commit/pre-push grep for unredacted CVE references; local tracker queue dashboard pane. | Explicit grep check instruction in `security-issue-fix` workflow step. | | **`family:pr-management`** | Interactive review pane with accept/skip/edit buttons for code review findings; triage sweep progress band. | Sequential `AskUserQuestion` prompts or consolidated review summary markdown. | diff --git a/plugins/magpie-setup/hooks/drift-check.test.ts b/plugins/magpie-setup/hooks/drift-check.test.ts index 370074a27..b39e25766 100644 --- a/plugins/magpie-setup/hooks/drift-check.test.ts +++ b/plugins/magpie-setup/hooks/drift-check.test.ts @@ -205,13 +205,16 @@ ref: v1.0.0 on('fs.exists', (_: any, e: any) => ({ value: true, })); - on('fs.read', (_: any, e: any) => ({ - value: e.path.endsWith('.apache-magpie.lock') - ? LOCK_BELOW_FLOOR - : e.path.endsWith('.claude-plugin/plugin.json') - ? JSON.stringify({ name: 'magpie-setup', version: '0.9.0' }) - : '', - })); + on('fs.read', (_: any, e: any) => { + const p = (e.path || '').replace(/\\/g, '/'); + return { + value: p.endsWith('.apache-magpie.lock') + ? LOCK_BELOW_FLOOR + : p.endsWith('.claude-plugin/plugin.json') + ? JSON.stringify({ name: 'magpie-setup', version: '0.9.0' }) + : '', + }; + }); on('ui.render', () => ({ type: 'Box', children: [] })); on('session.start', () => ({ cwd: '/work' })); @@ -236,13 +239,16 @@ ref: v1.0.0 on('fs.exists', (_: any, e: any) => ({ value: true, })); - on('fs.read', (_: any, e: any) => ({ - value: e.path.endsWith('.apache-magpie.lock') - ? LOCK_SATISFYING_FLOOR - : e.path.endsWith('.claude-plugin/plugin.json') - ? JSON.stringify({ name: 'magpie-setup', version: '0.9.0' }) - : '', - })); + on('fs.read', (_: any, e: any) => { + const p = (e.path || '').replace(/\\/g, '/'); + return { + value: p.endsWith('.apache-magpie.lock') + ? LOCK_SATISFYING_FLOOR + : p.endsWith('.claude-plugin/plugin.json') + ? JSON.stringify({ name: 'magpie-setup', version: '0.9.0' }) + : '', + }; + }); on('ui.render', () => ({ type: 'Box', children: [] })); on('session.start', () => ({ cwd: '/work' })); diff --git a/plugins/magpie-setup/hooks/drift-check.ts b/plugins/magpie-setup/hooks/drift-check.ts index 83bc4649a..086b6ba10 100644 --- a/plugins/magpie-setup/hooks/drift-check.ts +++ b/plugins/magpie-setup/hooks/drift-check.ts @@ -18,6 +18,7 @@ // under the License. import { atom, read, update } from 'claude-code'; +import { executeMagpieStatus } from './status-command.ts'; export const driftNotice = atom( { plugin: 'magpie-setup', key: 'driftNotice' }, @@ -495,8 +496,19 @@ export async function checkSetupDrift( * Event hook registration entry point for Claude Code. */ export function register(on: any): void { - // 1. Hook session.start to check for lockfile drift + // 1. Hook session.start to check for lockfile drift and register slash commands on('session.start', async ($: any, e: any, next: any) => { + try { + await $.command.register({ + name: 'magpie-status', + description: 'Print Apache Magpie adoption and health dashboard (zero-token)', + argumentHint: '[--format md|json]', + immediate: true, + }); + } catch { + // Safe no-op on command register exception + } + try { const workspaceDir = await $.session.root(); const pluginDir = $.plugin.root; @@ -526,7 +538,33 @@ export function register(on: any): void { } }); - // 2. Hook ui.render to display AbovePrompt drift banner if detected + // 2. Hook command.run on magpie-status (zero-token status dashboard) + on('command.run', { command: 'magpie-status' }, async ($: any, e: any) => { + try { + const workspaceDir = await $.session.root(); + const pluginDir = $.plugin.root; + const scriptPath = joinPath( + pluginDir, + 'skills', + 'status', + 'scripts', + 'collect_status.py' + ); + + return await executeMagpieStatus( + (argv, init) => $.process.run(argv, init), + scriptPath, + workspaceDir, + e.args + ); + } catch (err: any) { + return { + text: `⚠️ Apache Magpie: Unexpected error executing /magpie-status: ${err?.message || String(err)}`, + }; + } + }); + + // 3. Hook ui.render to display AbovePrompt drift banner if detected on('ui.render', { component: 'AbovePrompt' }, async ($: any, e: any, next: any) => { const notice = await read($, driftNotice); if (!notice) { diff --git a/plugins/magpie-setup/hooks/status-command.test.ts b/plugins/magpie-setup/hooks/status-command.test.ts new file mode 100644 index 000000000..e044ce644 --- /dev/null +++ b/plugins/magpie-setup/hooks/status-command.test.ts @@ -0,0 +1,258 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { describe, test } from 'claude-code/testing'; +import { executeMagpieStatus, type ProcessRunner, type ProcessRunResult } from './status-command.ts'; + +function assert(condition: any, message?: string): void { + if (!condition) { + throw new Error(message || 'Assertion failed'); + } +} + +function assertStrictEqual(actual: any, expected: any, message?: string): void { + if (actual !== expected) { + throw new Error(message || `Expected ${JSON.stringify(expected)} but got ${JSON.stringify(actual)}`); + } +} + +function assertDeepStrictEqual(actual: any, expected: any): void { + if (JSON.stringify(actual) !== JSON.stringify(expected)) { + throw new Error(`Expected deep equality: ${JSON.stringify(expected)} !== ${JSON.stringify(actual)}`); + } +} + +describe('magpie-status mod command (Pilot 2)', () => { + const workspaceDir = '/test/workspace'; + const scriptPath = '/test/plugin/skills/status/scripts/collect_status.py'; + const MOCK_MD_OUTPUT = '## apache-magpie adoption — test\n\n**verdict:** ✔ healthy'; + const MOCK_JSON_OUTPUT = '{\n "verdict": "healthy"\n}'; + + describe('executeMagpieStatus logic', () => { + test('invokes python3 with default markdown format and workspace repo', async () => { + const calls: Array<{ argv: readonly string[]; init?: any }> = []; + const runner: ProcessRunner = async (argv, init) => { + calls.push({ argv, init }); + return { exitCode: 0, stdout: MOCK_MD_OUTPUT, stderr: '' }; + }; + + const result = await executeMagpieStatus(runner, scriptPath, workspaceDir); + assertStrictEqual(result.text, MOCK_MD_OUTPUT); + assertStrictEqual(calls.length, 1); + assertDeepStrictEqual(calls[0]?.argv, [ + 'python3', + scriptPath, + '--format', + 'md', + '--repo', + workspaceDir, + ]); + assertStrictEqual(calls[0]?.init?.cwd, workspaceDir); + assertStrictEqual(calls[0]?.init?.env?.PYTHONIOENCODING, 'utf-8'); + }); + + test('honors --format json flag and requests pretty-printed JSON', async () => { + const calls: Array<{ argv: readonly string[] }> = []; + const runner: ProcessRunner = async (argv) => { + calls.push({ argv }); + return { exitCode: 0, stdout: MOCK_JSON_OUTPUT, stderr: '' }; + }; + + const result = await executeMagpieStatus(runner, scriptPath, workspaceDir, '--format json'); + assertStrictEqual(result.text, MOCK_JSON_OUTPUT); + assertStrictEqual(calls.length, 1); + assertDeepStrictEqual(calls[0]?.argv, [ + 'python3', + scriptPath, + '--format', + 'json', + '--pretty', + '--repo', + workspaceDir, + ]); + }); + + test('honors --format=json syntax and case-insensitivity', async () => { + const calls: Array<{ argv: readonly string[] }> = []; + const runner: ProcessRunner = async (argv) => { + calls.push({ argv }); + return { exitCode: 0, stdout: MOCK_JSON_OUTPUT, stderr: '' }; + }; + + const result1 = await executeMagpieStatus(runner, scriptPath, workspaceDir, '--format=json'); + assertStrictEqual(result1.text, MOCK_JSON_OUTPUT); + + const result2 = await executeMagpieStatus(runner, scriptPath, workspaceDir, '--FORMAT JSON'); + assertStrictEqual(result2.text, MOCK_JSON_OUTPUT); + assertStrictEqual(calls.length, 2); + }); + + test('honors --json flag alias', async () => { + const calls: Array<{ argv: readonly string[] }> = []; + const runner: ProcessRunner = async (argv) => { + calls.push({ argv }); + return { exitCode: 0, stdout: MOCK_JSON_OUTPUT, stderr: '' }; + }; + + const result = await executeMagpieStatus(runner, scriptPath, workspaceDir, '--json'); + assertStrictEqual(result.text, MOCK_JSON_OUTPUT); + assertStrictEqual(calls.length, 1); + assertDeepStrictEqual(calls[0]?.argv, [ + 'python3', + scriptPath, + '--format', + 'json', + '--pretty', + '--repo', + workspaceDir, + ]); + }); + + test('falls back cleanly to python when python3 command throws (e.g. ENOENT)', async () => { + const calls: string[][] = []; + const runner: ProcessRunner = async (argv) => { + calls.push([...argv]); + if (argv[0] === 'python3') { + throw new Error('spawn python3 ENOENT'); + } + return { exitCode: 0, stdout: MOCK_MD_OUTPUT, stderr: '' }; + }; + + const result = await executeMagpieStatus(runner, scriptPath, workspaceDir); + assertStrictEqual(result.text, MOCK_MD_OUTPUT); + assertStrictEqual(calls.length, 2); + assertStrictEqual(calls[0]?.[0], 'python3'); + assertStrictEqual(calls[1]?.[0], 'python'); + assertDeepStrictEqual(calls[1]?.slice(1), [ + scriptPath, + '--format', + 'md', + '--repo', + workspaceDir, + ]); + }); + + test('falls back to python when python3 exits with non-zero exit code', async () => { + const calls: string[][] = []; + const runner: ProcessRunner = async (argv) => { + calls.push([...argv]); + if (argv[0] === 'python3') { + return { exitCode: 127, stdout: '', stderr: 'python3 not found' }; + } + return { exitCode: 0, stdout: MOCK_MD_OUTPUT, stderr: '' }; + }; + + const result = await executeMagpieStatus(runner, scriptPath, workspaceDir); + assertStrictEqual(result.text, MOCK_MD_OUTPUT); + assertStrictEqual(calls.length, 2); + assertStrictEqual(calls[0]?.[0], 'python3'); + assertStrictEqual(calls[1]?.[0], 'python'); + }); + + test('returns actionable diagnostic error when both python3 and python fail', async () => { + const runner: ProcessRunner = async () => { + return { exitCode: 1, stdout: '', stderr: 'No module named internal_magpie' }; + }; + + const result = await executeMagpieStatus(runner, scriptPath, workspaceDir); + assert(result.text.includes('Unable to execute deterministic status collector')); + assert(result.text.includes('No module named internal_magpie')); + assert(result.text.includes('/magpie-setup status')); + }); + + test('prefers python error when python3 exits with 127 (not found)', async () => { + const runner: ProcessRunner = async (argv) => { + if (argv[0] === 'python3') { + return { exitCode: 127, stdout: '', stderr: 'python3: command not found' }; + } + return { exitCode: 1, stdout: '', stderr: 'SyntaxError: invalid syntax in collect_status.py' }; + }; + + const result = await executeMagpieStatus(runner, scriptPath, workspaceDir); + assert(result.text.includes('SyntaxError: invalid syntax in collect_status.py')); + }); + }); + + describe('Claude Code hook registration and /magpie-status command execution', () => { + test('registers and executes /magpie-status returning stdout in session transcript', async ($: any, on: any) => { + const registeredCommands: any[] = []; + on('command.register', (_: any, e: any) => { + registeredCommands.push(e); + return { value: undefined }; + }); + + on('session.start', () => ({ cwd: '/test/workspace' })); + on('session.root', () => ({ value: '/test/workspace' })); + on('fs.exists', () => ({ value: false })); + on('fs.read', () => ({ value: '' })); + on('ui.render', () => ({ type: 'Box', children: [] })); + + on('process.run', (_: any, e: any) => { + return { + value: { + exitCode: 0, + stdout: MOCK_MD_OUTPUT, + stderr: '', + }, + }; + }); + + await $.session.start({ surface: 'terminal', isInteractive: true, cwd: '/test/workspace' }); + + // Verify that magpie-status was registered with immediate: true + const reg = registeredCommands.find((c) => c.name === 'magpie-status'); + assert(reg, 'Expected magpie-status command to be registered'); + assertStrictEqual(reg.name, 'magpie-status'); + assertStrictEqual(reg.immediate, true); + + // Verify command execution + const answer = await $.command.run({ command: 'magpie-status', args: '' }); + assertStrictEqual(answer.text, MOCK_MD_OUTPUT); + }); + + test('executes /magpie-status with --format json returning formatted JSON', async ($: any, on: any) => { + on('command.register', () => ({ value: undefined })); + on('session.start', () => ({ cwd: '/test/workspace' })); + on('session.root', () => ({ value: '/test/workspace' })); + on('fs.exists', () => ({ value: false })); + on('fs.read', () => ({ value: '' })); + on('ui.render', () => ({ type: 'Box', children: [] })); + + let receivedArgv: readonly string[] = []; + on('process.run', (_: any, e: any) => { + receivedArgv = e.argv || []; + return { + value: { + exitCode: 0, + stdout: MOCK_JSON_OUTPUT, + stderr: '', + }, + }; + }); + + await $.session.start({ surface: 'terminal', isInteractive: true, cwd: '/test/workspace' }); + + const answer = await $.command.run({ command: 'magpie-status', args: '--format json' }); + assertStrictEqual(answer.text, MOCK_JSON_OUTPUT); + assert(receivedArgv.includes('--format'), 'Expected argv to include --format'); + assert(receivedArgv.includes('json'), 'Expected argv to include json'); + assert(receivedArgv.includes('--pretty'), 'Expected argv to include --pretty'); + }); + }); +}); diff --git a/plugins/magpie-setup/hooks/status-command.ts b/plugins/magpie-setup/hooks/status-command.ts new file mode 100644 index 000000000..5fa0e9887 --- /dev/null +++ b/plugins/magpie-setup/hooks/status-command.ts @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import { joinPath } from './drift-check.ts'; + +export interface ProcessRunResult { + exitCode: number; + stdout: string; + stderr: string; +} + +export type ProcessRunner = ( + argv: readonly string[], + init?: { cwd?: string; env?: Record; timeoutMs?: number } +) => Promise; + +/** + * Executes collect_status.py deterministically via process runner (python3 or python). + */ +export async function executeMagpieStatus( + runProcess: ProcessRunner, + scriptPath: string, + workspaceDir: string, + rawArgs?: string +): Promise<{ text: string }> { + const args = (rawArgs || '').trim(); + const isJson = /(?:--format[=\s]+json|--json)(?:\s|$)/i.test(args); + + const collectorArgs: string[] = isJson + ? [scriptPath, '--format', 'json', '--pretty', '--repo', workspaceDir] + : [scriptPath, '--format', 'md', '--repo', workspaceDir]; + + // Try python3 first, fallback to python + let result: ProcessRunResult | undefined; + let executionError: Error | undefined; + + try { + result = await runProcess(['python3', ...collectorArgs], { + cwd: workspaceDir, + env: { PYTHONIOENCODING: 'utf-8' }, + }); + } catch (err: any) { + executionError = err instanceof Error ? err : new Error(String(err)); + } + + // If python3 failed to run (e.g. command not found) or returned non-zero, try python + if (!result || result.exitCode !== 0) { + try { + const fallbackResult = await runProcess(['python', ...collectorArgs], { + cwd: workspaceDir, + env: { PYTHONIOENCODING: 'utf-8' }, + }); + if (fallbackResult.exitCode === 0 || !result || result.exitCode === 127) { + result = fallbackResult; + if (fallbackResult.exitCode === 0) { + executionError = undefined; + } + } + } catch (fallbackErr: any) { + if (!executionError) { + executionError = fallbackErr instanceof Error ? fallbackErr : new Error(String(fallbackErr)); + } + } + } + + if (result && result.exitCode === 0) { + return { text: result.stdout.trimEnd() }; + } + + const errorLines = [ + '⚠️ Apache Magpie: Unable to execute deterministic status collector (`collect_status.py`).', + ]; + if (result?.stderr?.trim()) { + errorLines.push(`Error: ${result.stderr.trim()}`); + } else if (executionError?.message) { + errorLines.push(`Error: ${executionError.message}`); + } + errorLines.push( + 'Please verify that Python 3 is installed and available on PATH, or invoke the full workflow via `/magpie-setup status`.' + ); + + return { text: errorLines.join('\n\n') }; +} + +export default executeMagpieStatus; diff --git a/plugins/magpie-setup/skills/status/SKILL.md b/plugins/magpie-setup/skills/status/SKILL.md index 9754983bf..eb865c6d6 100644 --- a/plugins/magpie-setup/skills/status/SKILL.md +++ b/plugins/magpie-setup/skills/status/SKILL.md @@ -148,7 +148,10 @@ python3 /skills/setup-status/scripts/collect_status.py `.apache-magpie/skills/setup-status/scripts/`; invoke it via the `magpie-setup-status` symlink's resolved path. The default output is the Markdown dashboard; pass `--format json` only when tooling -needs the raw fields — see [`collect.md`](collect.md).) +needs the raw fields — see [`collect.md`](collect.md). In Claude Code +with mods enabled, the zero-token `/magpie-status` code command executes +this collector directly via `$.process.run` with zero model turns and +zero token cost.) > **OUTPUT CONTRACT — non-negotiable.** Present the script's > Markdown output **verbatim** (it is already GitHub-flavoured diff --git a/plugins/magpie-setup/skills/status/scripts/collect_status.py b/plugins/magpie-setup/skills/status/scripts/collect_status.py index 838d55c67..fd53fdc24 100644 --- a/plugins/magpie-setup/skills/status/scripts/collect_status.py +++ b/plugins/magpie-setup/skills/status/scripts/collect_status.py @@ -758,6 +758,12 @@ def main(argv: list[str] | None = None) -> int: "gitignore": gitignore_coverage(root, targets), } + try: + if getattr(sys.stdout, "reconfigure", None): + sys.stdout.reconfigure(encoding="utf-8") + except Exception: + pass + if args.format == "md": sys.stdout.write(render_markdown(result)) else: From 0079f8ff472e0913c7ac964d6ba801086e7e4d7f Mon Sep 17 00:00:00 2001 From: Vardhman Gupta Date: Mon, 12 Oct 2026 10:44:00 +0530 Subject: [PATCH 2/3] fix(setup): revert status/SKILL.md prose edit to preserve measured_tokens stamp --- plugins/magpie-setup/skills/status/SKILL.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/magpie-setup/skills/status/SKILL.md b/plugins/magpie-setup/skills/status/SKILL.md index eb865c6d6..9754983bf 100644 --- a/plugins/magpie-setup/skills/status/SKILL.md +++ b/plugins/magpie-setup/skills/status/SKILL.md @@ -148,10 +148,7 @@ python3 /skills/setup-status/scripts/collect_status.py `.apache-magpie/skills/setup-status/scripts/`; invoke it via the `magpie-setup-status` symlink's resolved path. The default output is the Markdown dashboard; pass `--format json` only when tooling -needs the raw fields — see [`collect.md`](collect.md). In Claude Code -with mods enabled, the zero-token `/magpie-status` code command executes -this collector directly via `$.process.run` with zero model turns and -zero token cost.) +needs the raw fields — see [`collect.md`](collect.md).) > **OUTPUT CONTRACT — non-negotiable.** Present the script's > Markdown output **verbatim** (it is already GitHub-flavoured From 312e98428ee1352f78d4a46376566a1f95e3f55f Mon Sep 17 00:00:00 2001 From: Vardhman Gupta Date: Mon, 12 Oct 2026 10:58:14 +0530 Subject: [PATCH 3/3] fix(setup): revert collect_status.py to keep existing collector untouched --- .../magpie-setup/skills/status/scripts/collect_status.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugins/magpie-setup/skills/status/scripts/collect_status.py b/plugins/magpie-setup/skills/status/scripts/collect_status.py index fd53fdc24..838d55c67 100644 --- a/plugins/magpie-setup/skills/status/scripts/collect_status.py +++ b/plugins/magpie-setup/skills/status/scripts/collect_status.py @@ -758,12 +758,6 @@ def main(argv: list[str] | None = None) -> int: "gitignore": gitignore_coverage(root, targets), } - try: - if getattr(sys.stdout, "reconfigure", None): - sys.stdout.reconfigure(encoding="utf-8") - except Exception: - pass - if args.format == "md": sys.stdout.write(render_markdown(result)) else: