Claude Code's status reports never reach harrier on Windows #12
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
wayfinder:map
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jeff/harrier#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
harrier handles OSC 7501 (Program Status Protocol) end to end and answers the
?probe (libghostty replies becauseSession.zigsets theprogram_statuseffect). On Windows none of it is used: Claude Code (2.1.295+) sends OSC 7501 only after a reply toOSC 7501 ; ?, and in a harrier pane its debug log saysWindows' own console host, which
src/backend/ConPty.ziggets fromCreatePseudoConsole, drops OSC 7501: a report written in a pane (Write-Host -NoNewline "`e]7501;state=working:app=test`e\") never reaches the status button. It also answers some queries itself: DECRQM 2026 came back with status 0 though harrier has the mode.Claude Code never sends harrier OSC 9;4 (it does only for ConEmu, Ghostty ≥1.2.0 and iTerm2 ≥3.6.6, by environment), so OSC 7501 is the only path.
Decision recorded in
docs/adr/0003-ship-our-own-conpty.md.Tasks
Microsoft.Windows.Console.ConPTY's.nupkg(a zip) tobuild.zig.zonas a lazy dependency, fetched only for Windows targets; regeneratebuild.zig.zon.nix. Zig takes the archive type from the URL path alone, so the.nupkgis mirrored, unchanged, ashttps://git.jcollie.dev/api/packages/jeff/generic/conpty/1.25.260930003/microsoft.windows.console.conpty.1.25.260930003.zip.build.ziginstalls x64conpty.dllandOpenConsole.exebesideharrier.exeinzig-out/bin.msi.nixcopies both from${exe}/binintostage/;dist/windows/harrier.wxsinstalls them beside harrier.exe.ConPty.zigloadsCreatePseudoConsole,ResizePseudoConsoleandClosePseudoConsolefrom thatconpty.dll, by full path from harrier.exe's directory (never the DLL search order; elevated harrier, ADR 0001), with function types from zigwin32. If it will not load, fall back to Windows' own and log a warning once per run. No config option.OSC 7501 ; ?is answered through our console host, and not through Windows' own.main:claude --debuglogsprogramStatus=yes (probe: OSC 7501 reply), and DECRQM 2026 is answered by harrier (status=2); Claude Code's reports reach the pane.Then: Claude Code's OSC 133;A
Claude Code sends
OSC 133;A;redraw=0when a turn starts (found later: only in screen reader mode,--ax-screen-reader, and at each step of a turn). On a prompt start harrier drops everyworkingandblockedrecord (status.zigendWork), as the spec requires, and Claude Code resends a record only when its text changes. So a background-task child that is stillworkingacross turns, or a rootworkingreport sent before the 133;A, is dropped and never comes back.The ConPTY work is in:
5053855(ADR 0003),a6e7328,8207473and5f61747.ConPty.zigmakes each pseudoconsole with theconpty.dllbeside harrier.exe, loaded by its full path, and only whenx64\OpenConsole.exeis there too: without it,conpty.dllquietly runs Windows' own console host. When either is missing, or ours cannot make one, harrier logs a warning once and uses Windows' own. A pane's pseudoconsole is closed and resized by the one that made it.grapheme_widthsays (PSEUDOCONSOLE_GLYPH_WIDTH_GRAPHEMES/_WCSWIDTH).conpty.dll,x64\OpenConsole.exeand Microsoft's license asLICENSES\conpty.txt;nix build .#msibuilds, and its File table lists all three.8207473and5f61747fixnix build .#msiitself: the Windows build was passed-Dbindir, which only Linux declares, and the package's source left outtools/ico.zig.Probe in a pane:
OSC 7501 ; ?then DA1, recording what comes back.ESC ]7501;?:states=idle,working,done,blocked,error:kinds=permission,question,auth ESC \conpty.dll)conpty.dllwithoutOpenConsole.exeCursor after
➡️X(CPR): column 4 under.unicode, 3 under.legacy, through ours.Left: the check from the installed MSI, and the OSC 133;A part.
Claude Code now reports its status to harrier on Windows: in a harrier built from
main,claude --debuglogsprogramStatus=yes (probe: OSC 7501 reply)andsynchronizedOutput=yes (probe: DECRPM 2026 status=2), the second now answered by harrier rather than Windows' console host.OSC 133;A. Claude Code marks prompts only in screen reader mode (
--ax-screen-reader,CLAUDE_AX_SCREEN_READER, or theaxScreenReadersetting); with the defaults it sends none, and nothing is lost. In screen reader mode it marks133;Aat each step of a turn, and after the first turn the mark comes after its rootworkingreport. Traced in a harrier pane, each report and mark as the terminal saw them, with the records held just before:idle, A,working, C, D,doneworking, nothing lost7501 working133 Aworking, as the spec says7501 working7501 working133 AA background shell command (
sleep 90) is not reported as a child record: Claude Code reports only background subagents and workflow tasks as children. Those would be dropped the same way, but this trace has none.3c40fcaadds a test replaying it. harrier keeps the spec's rule; the fix is Claude Code's, and the upstream report is drafted for a human to file: don't send133;Awhileworkingorblockedrecords are out, or resend every record after it.Left: the check from the installed MSI, and filing the upstream report.
Checked from the installed MSI: Claude Code's status shows in harrier.
nix buildpasses, so 3c40fca's test runs on Linux too. Closing; the upstream report to Claude Code is drafted but not yet filed, and is tracked outside this issue.