Skip to content

[Bug][Windows]: ocx 서비스 상태가 로컬화된 schtasks 출력을 UTF-8로 디코딩함 #722

Description

@luvs01

Client or integration

Codex CLI

Area

Service lifecycle

Summary

On Korean Windows with active code page 949, ocx service status decodes the localized schtasks.exe /query output as UTF-8. The command succeeds, but the Task Scheduler table is printed as mojibake.

This remains reproducible in OpenCodex 2.7.43. #591/#698 fixed locale-independent access-denied classification, but did not fix the user-visible status output.

Expected: ocx service status should print a readable, locale-independent OpenCodex service summary, or correctly decode the Windows native output.

The service remains operational, but the command's main diagnostic table becomes unreadable on CP949 Windows and produces poor support evidence. A locale-independent structured summary would avoid needing CP949/GBK/Shift-JIS-specific decoding.

Reproduction

  1. Use Korean Windows with active code page 949.
  2. Install and start the Task Scheduler backend.
  3. Run:
chcp
ocx service status
  1. Observe replacement characters in the scheduler table.

A minimal regression could inject mojibake-shaped raw scheduler output and assert that service status formats an OpenCodex-owned structured summary instead of printing the localized table verbatim. It should cover installed/running, installed/not running, and not installed states.

Version

2.7.43 (v2.7.43, commit d1f544bbc22d25b9b2bd3c8e776fb8e3242b4ed5)

Operating system

Windows 11 Pro 25H2, build 26200.8894, Korean locale / CP949

Provider and model

Not provider-specific

Logs or error output

Active code page: 949

✅ running:
����: \
�۾� �̸�                                ���� ���� �ð�         ����
======================================== ====================== ===============
opencodex-proxy                          N/A                    �غ�
Diagnostics: logs: %USERPROFILE%\.opencodex\service.log

Screenshots and supporting files

The same user-visible mojibake appeared in diagnostics on #591, but #698 only changed access-denied classification. Its changed files did not alter the raw service status rendering path.

Current main and dev still decode the native command as UTF-8 and print it verbatim:

  • opencodex/src/service.ts

    Lines 353 to 375 in d1f544b

    function sh(cmd: string): string {
    return execSync(cmd, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim();
    }
    function runFile(file: string, args: string[]): string {
    return execFileSync(file, args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], windowsHide: true }).trim();
    }
    function windowsSchtasks(): string {
    return resolveTrustedWindowsSchtasksExe();
    }
    function windowsWscript(): string {
    const candidate = join(process.env.SystemRoot ?? "C:\\Windows", "System32", "wscript.exe");
    return existsSync(candidate) ? candidate : "wscript.exe";
    }
    let querySchtasksForTests: ((args: string[]) => string) | null = null;
    function querySchtasks(args: string[]): string {
    if (querySchtasksForTests) return querySchtasksForTests(args);
    return runFile(windowsSchtasks(), args);
    }
  • opencodex/src/service.ts

    Lines 1264 to 1267 in d1f544b

    function startWindows(): void { schtasks(["/run", "/tn", TASK]); }
    function stopWindows(): void { try { schtasks(["/end", "/tn", TASK]); } catch { /* not running */ } }
    function statusWindows(): string { try { return schtasks(["/query", "/tn", TASK]); } catch { return ""; } }
    function statusWindowsXml(): string { try { return schtasks(["/query", "/tn", TASK, "/xml"]); } catch { return ""; } }
  • opencodex/src/service.ts

    Lines 1752 to 1755 in d1f544b

    case "status": {
    const s = ops.status();
    console.log(s ? `✅ running:\n${s}` : "❌ service not installed/running.");
    console.log(`Diagnostics: ${serviceDiagnosticsSummary()}`);

Redacted configuration

Not configuration-dependent. Reproduced with the Windows Task Scheduler service backend on Korean Windows / CP949.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.
Translated Message

Original language: Korean

클라이언트 또는 통합

Codex CLI

영역

서비스 생애주기

요약

한국어 Windows에서 활성 코드 페이지 949와 함께, ocx service status가 로컬화된 schtasks.exe /query 출력을 UTF-8로 디코딩합니다. 이 명령은 성공하지만, 작업 스케줄러 테이블이 모지베이크 형식으로 출력됩니다.

이는 OpenCodex 2.7.43에서도 재현됩니다. #591/#698은 로케일 독립적인 접근 거부 분류를 수정했지만, 사용자에게 보여지는 상태 출력을 수정하지 않았습니다.

예상: ocx service status는 읽을 수 있는 로케일 독립적인 OpenCodex 서비스 요약을 출력하거나 Windows 네이티브 출력을 올바르게 디코딩해야 합니다.

서비스는 계속 운영되지만, 명령의 주요 진단 테이블은 CP949 Windows에서 읽을 수 없게 되며 지원 증거가 부족해집니다. 로케일 독립적인 구조화된 요약은 CP949/GBK/Shift-JIS 특정 디코딩의 필요성을 피할 수 있습니다.

재현

  1. 한국어 Windows에서 활성 코드 페이지 949를 사용하십시오.
  2. 작업 스케줄러 백엔드를 설치하고 시작하십시오.
  3. 다음을 실행하십시오:
chcp
ocx service status
  1. 스케줄러 테이블에서 대체 문자들을 관찰하십시오.

최소한의 회귀는 모지베이크 모양의 원시 스케줄러 출력을 주입하고 service status가 로컬화된 테이블을 원문 그대로 출력하는 대신 OpenCodex 소유의 구조화된 요약을 형식화하는지 확인해야 합니다. 설치됨/실행 중, 설치됨/실행 중 아님, 설치되지 않음 상태를 커버해야 합니다.

버전

2.7.43 (v2.7.43, commit d1f544bbc22d25b9b2bd3c8e776fb8e3242b4ed5)

운영 체제

Windows 11 Pro 25H2, build 26200.8894, 한국어 로케일 / CP949

공급자 및 모델

공급자 특정 아님

로그 또는 오류 출력

Active code page: 949

✅ running:
����: 
�۾� �̸�                                ���� ���� �ð�         ����
======================================== ====================== ===============
opencodex-proxy                          N/A                    �غ�
Diagnostics: logs: %USERPROFILE%\.opencodex\service.log

스크린샷 및 지원 파일

같은 사용자 표시 모지베이크가 #591의 진단에서 나타났지만, #698은 접근 거부 분류만 변경했습니다. 변경된 파일은 원시 service status 렌더링 경로를 수정하지 않았습니다.

현재 maindev는 여전히 네이티브 명령을 UTF-8로 디코딩하고 원문 그대로 출력합니다:

  • opencodex/src/service.ts

    Lines 353 to 375 in d1f544b

    function sh(cmd: string): string {
    return execSync(cmd, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim();
    }
    function runFile(file: string, args: string[]): string {
    return execFileSync(file, args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], windowsHide: true }).trim();
    }
    function windowsSchtasks(): string {
    return resolveTrustedWindowsSchtasksExe();
    }
    function windowsWscript(): string {
    const candidate = join(process.env.SystemRoot ?? "C:\\Windows", "System32", "wscript.exe");
    return existsSync(candidate) ? candidate : "wscript.exe";
    }
    let querySchtasksForTests: ((args: string[]) => string) | null = null;
    function querySchtasks(args: string[]): string {
    if (querySchtasksForTests) return querySchtasksForTests(args);
    return runFile(windowsSchtasks(), args);
    }
  • opencodex/src/service.ts

    Lines 1264 to 1267 in d1f544b

    function startWindows(): void { schtasks(["/run", "/tn", TASK]); }
    function stopWindows(): void { try { schtasks(["/end", "/tn", TASK]); } catch { /* not running */ } }
    function statusWindows(): string { try { return schtasks(["/query", "/tn", TASK]); } catch { return ""; } }
    function statusWindowsXml(): string { try { return schtasks(["/query", "/tn", TASK, "/xml"]); } catch { return ""; } }
  • opencodex/src/service.ts

    Lines 1752 to 1755 in d1f544b

    case "status": {
    const s = ops.status();
    console.log(s ? `✅ running:\n${s}` : "❌ service not installed/running.");
    console.log(`Diagnostics: ${serviceDiagnosticsSummary()}`);

적출된 구성

구성에 따라 다르지 않음. 한국어 Windows / CP949에서 Windows 작업 스케줄러 서비스 백엔드로 재현됨.

확인

  • 기존 문제 및 문서를 검색했습니다.
  • 비밀, 토큰, 계정 세부정보, 요청 자격 증명 및 개인 데이터를 제거했습니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions