Skip to content

feat(windows): supervise the gateway through Task Scheduler - #11289

Open
GoZippy wants to merge 1 commit into
kirodotdev:mainfrom
GoZippy:feat/windows-task-scheduler-service
Open

GoZippy wants to merge 1 commit into
kirodotdev:mainfrom
GoZippy:feat/windows-task-scheduler-service

Conversation

@GoZippy

@GoZippy GoZippy commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On Windows, kirocrew service install registers a per-user Task Scheduler task that brings the gateway back after the loop-stall watchdog terminates it, as systemd and launchd already do.

The loop-stall watchdog is designed to terminate the gateway:
faulthandler.dump_traceback_later(..., exit=True) calls _exit(1) after
writing its dump. On Linux systemd brings it back, on macOS launchd does, and
on Windows nothing did. kirocrew service install answered "only supported on
Linux (systemd) and macOS (launchd)".

So on Windows a process designed to exit was paired with no supervised
lifetime. The gateway did not crash-loop; it stopped and stayed stopped until a
human noticed, with channels silent and cron not firing. Reported as
#6590.

Why it matters

This is the failure mode with no symptom. A crash loop is visible. A gateway
that exited cleanly at 3am and was never restarted looks, from every surface an
operator checks, like a quiet night.

Not a goal

What changed (motivation → approach → change)

Windows gets a third service backend beside systemd and launchd. kirocrew service install, start, stop, restart, status and uninstall now work there, with no elevation, through a per-user task at \KiroCrew\gateway.

The task supervises through its triggers, not through RestartOnFailure. A live Task Scheduler showed that a task whose action exits 1 is never restarted by RestartOnFailure; a trigger that repeats every minute with no end, plus IgnoreNew, starts a fresh gateway within the minute and never doubles a healthy one. A time trigger starting at install arms that repetition at once, and the logon trigger re-arms it after each sign-in.

Piece What it does
service/windows.py Renders the task as XML (no time limit, battery settings off, repeating trigger), registers it last after every step that can fail, and never reads localized schtasks prose: absence is confirmed by the task's own path missing from an answered task list. stop disables the task so the next tick cannot undo it. restart leaves alone a gateway that still serves the port after /End, since that one is not the task's. stop asks whether anything still holds the port the client resolver names; status and restart ask a stricter question, whether this install's gateway is serving: its run marker names a live pid and /api/ready answers 200. The task runs the kirocrew console script (next to the interpreter, else in the per-user Scripts dir a pip install --user fills) with gateway --no-open, as the systemd unit and launchd plist do. Install refuses a relative KIROCREW_HOME, which the task would resolve again from inside the data home, and refuses when KIROCREW_HOME, KIROCREW_PORT or KIROCREW_KIRO_BIN differ between this shell and the persistent environment a logon would build (the user value, else the machine value, with REG_EXPAND_SZ expanded). The prior readback copy is read without following a link, hardlink or oversized file; such a copy stops the install before anything is written.
service/common.py current_platform() answers SCHTASKS on Windows only when schtasks.exe resolves through the trusted system path, never PATH. RestartReport gains unmanaged_gateway.
service/controller.py Dispatches each verb to the new backend. A scheduler refusal, or a gateway the task does not own, returns the same "not handled" answer the foreground fallback expects; the second also sets unmanaged_gateway. A restart counts only once the relaunched gateway reports ready within 60 seconds, else it reports RESTART_NOT_UP pointing at kirocrew logs, as the systemd path does for a unit that does not stay up. service status exits 0 only with the task installed and this install's gateway serving.
cli_server_restart.py The restart command skips its installed-service refusal when the report sets unmanaged_gateway, so a foreground gateway beside a stopped task is restarted instead of exiting 1.
cli_server.py kirocrew logs keeps its built-in reader on a Windows host with the service backend, instead of running tail, which Windows does not have.

docs/guides/windows-install.md gains a row for kirocrew service install / status / uninstall and kirocrew stop / restart. The new schtasks chokepoint is listed in the spawn audit table, and service/common.py leaves .github/black-baseline.txt because it is now black-clean.

Backwards compatibility

Compatible: Linux and macOS paths are unchanged; on Windows, kirocrew service verbs that used to exit 2 as unsupported now run.

Removes nothing: the diff only adds a backend, a platform value and a report field that defaults to off.

Tests

  • test/test_service_windows.py: the rendered document (both triggers repeat with no Duration, the time trigger starts at install, PT0S time limit, battery settings off, IgnoreNew, a hostile username cannot break the XML), the --no-open launch arguments, the probe following KIROCREW_PORT, every verb's exit-code handling, confirmed absence (an answered list without the task, a refused list, a listed task whose query was refused, a similarly named task), restart leaving a foreground gateway alone, the trusted-path staging, the environment refusal, the persistent lookup (expansion, machine fallback, user precedence, an unreadable key failing closed), a relative KIROCREW_HOME refused even when persisted, the per-user Scripts console script chosen over the -I fallback, a linked, hardlinked or oversized readback copy refusing before anything runs, is_serving needing a live recorded pid and a 200 from /api/ready, and that a failed readback or staging write registers nothing and leaves no stale readback copy.
  • test/test_service_controller.py: scheduler refusals degrade to the foreground fallback, a refused restart reports RESTART_REFUSED, a restart whose gateway never reports ready reports RESTART_NOT_UP, status exits 1 when only another program holds the port, a gateway the task does not own goes to the foreground path with unmanaged_gateway set, service status exits 1 without a task, and a stop that did not reach the gateway is not claimed.
  • test/test_cli_restart.py: a report with unmanaged_gateway set takes the foreground restart path even while an installed service reads active.
  • test/test_service.py: platform detection with and without a trusted schtasks.exe.
  • test/test_windows_logs_and_diagnostics.py: the log-reader tests run for both UNSUPPORTED and SCHTASKS, so kirocrew logs on either never reaches tail.

Determinism: the port-release wait runs on a ManualClock, and no test reaches a real socket or schtasks.exe.

Manual verification

From the original author, against a live Task Scheduler on Windows 10 Pro 19045, using the module's own render and _schtasks path with a stub in place of the gateway. The UTF-16 definition was accepted by /Create /XML, and every setting above survived a /Query /XML round trip.

mechanism stub exit runs in 8.5 min
RestartOnFailure PT1M x3 1 1, never restarted
RestartOnFailure PT1M x3 0 1, correct
trigger Repetition PT1M 1 5, one per minute

IgnoreNew dropped every tick while a stub held the slot, and the next tick after it exited started a fresh instance. stop() silenced a repeating task for the next two ticks.

Still unverified on a live host: the install-time TimeTrigger, the task-list absence check, a second Windows build (11 or Server), and DisallowStartIfOnBatteries on a host with a battery.

Related Issues

Part of #6590

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@GoZippy
GoZippy requested review from a team and iamwhatever September 16, 2026 10:47
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Sep 16, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 16, 2026
@GoZippy
GoZippy force-pushed the feat/windows-task-scheduler-service branch from 9f85e22 to 874ef4f Compare September 16, 2026 12:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 16, 2026
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 0198bcce8dda240eb87e8e034f85f15dd2b689e7 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the per-user task with a repeating trigger and IgnoreNew directly addresses #6590's unsupervised exit. The other Windows verbs still fall back to the foreground path when the task is absent or the scheduler refuses.

Notes

  • The install-time TimeTrigger is still unverified on a live host. It is the only thing that arms supervision before the next sign-in. Confirm it with one live run, where a stub exits 1 after service install and is relaunched within a minute without a logon.
  • install_service reports ❌ when start() fails after install() has already registered an enabled, repeating task. The operator reads it as a failed install while the task keeps running every minute. Say so in the error, or disable the task on that branch.

[DESIGN-REVIEWED] 0198bcc

Description read

[DESCRIPTION-READ] 058df02fce368fb7cbea3ea6b921ddbf7b1a650b43775c31678b5b47784f16ef

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of d1c6b10baba42ad43bdb1443290d1e359a88f34f via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the backend is an opt-in fix for #6590, which was reported and reproduced on a live host. Three small parts of it could be deleted.

Notes

  • Item 6 — oversized: RestartOnFailure is kept "for the launch failure it does cover", but the repeating PT1M trigger already retries a launch that failed, once a minute. Subtraction: delete the <RestartOnFailure> block and RESTART_COUNT.
  • Item 7 — oversized: the readback copy is kept "for kirocrew doctor to diff against the live task", yet task_xml_path|kirocrew-gateway.xml has 0 consumers in base src/. Its only readers are install() and one print line. Subtraction: delete the data-home copy, _restore_readback and its prior bookkeeping, and stage only to the temp dir.
  • Item 8 — duplicate of src/kiro_crew/pod/windows.py:202: service/windows.schtasks_bin() is the same trusted_system_bin("schtasks") one-liner, and common.current_platform() adds a third copy. Subtraction: call platform_compat.trusted_system_bin("schtasks") directly and delete the wrapper.

What this change ships

Inventory (9 items) — 6 justified

Intent: bring a Windows gateway back after the watchdog ends it, without a human noticing first — FIX.

  1. kirocrew service install/start/stop/restart/status/uninstall now work on Windows — justified
  2. kirocrew stop disables the task; restart re-enables it — justified
  3. install refuses when HOME/PORT/KIRO_BIN differ from the persistent environment — justified
  4. a foreground gateway beside a stopped task is restarted, not refused (unmanaged_gateway) — justified
  5. kirocrew logs keeps its built-in reader on Windows — rides along
  6. RestartOnFailure ×3 alongside the repeating trigger — oversized
  7. a readback XML copy kept under the data home — oversized
  8. a second schtasks_bin() — duplicate of pod/windows.py:202
  9. common.py black reflow and its baseline row dropped — rides along

[FIRST-PRINCIPLES-REVIEWED] d1c6b10

Description read

[DESCRIPTION-READ] 634c5c5ef036ec27c6a49893faa27381f061deeab74512a644c3c023568a170a

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — 🔴 changes requested (blocking)

Reviewed 0198bcce8dda240eb87e8e034f85f15dd2b689e7 via the fork AI-review pipeline; updated in place on each push.

Adjudication upheld 2 of 2 blocking finding(s); those must be resolved before merging.

BLOCKING -- src/kiro_crew/service/windows.py:839 -- Probe the configured listener instead of assuming IPv4 loopback

url = f"http://127.0.0.1:{port}/api/ready"
Trigger: A Windows gateway binds to the supported IPv6 wildcard ::. service_status() and restart_service() reach this probe through is_serving(), but _bind_once() sets IPV6_V6ONLY and _start_secondary_loopback_site() adds no IPv4 listener for wildcard binds.
Outcome: A healthy gateway reports “not running” with exit 1; a successful restart reports RESTART_NOT_UP after the readiness timeout. is_active() has the same IPv4-only assumption.
Anchor: defect
Fix: Resolve both probes’ addresses from the gateway’s configured bind, mapping IPv6 wildcard binds to IPv6 loopback.

BLOCKING -- test/test_service_windows.py:498 -- Isolate the user-script lookup in the fallback test

assert arguments.split()[0] == "-I"
Trigger: Run this test on Windows with a pip install --user console script present. The test replaces only the interpreter path; gateway_command() still calls _user_scripts_dir() and selects the real per-user kirocrew.exe.
Outcome: The arguments are gateway --no-open, so the assertion fails on a supported developer installation despite correct production behavior.
Anchor: defect
Fix: Stub _user_scripts_dir() to an empty directory under tmp_path in this test.

[BLOCK-MERGE] 0198bcc
[GPT-REVIEWED] 0198bcc

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 — MEDIUM: an operator who sets KIROCREW_BIND=:: gets a healthy gateway reported as "not running" (exit 1), and a restart that worked is reported as RESTART_NOT_UP. The wrong answer is visible but recurs on every call. Confirmed the gateway binds :: IPv6-only, so it never answers an IPv4 connect (src/kiro_crew/dashboard/server_runtime/listener.py:218-219), and the probes in this patch hardcode 127.0.0.1. A wildcard bind gets no second loopback listener (listener.py:423-426).
The real fix costs almost nothing: gateway_lock.probe_host_for_bind (src/kiro_crew/gateway_lock.py:278-294) already maps :: to ::1, so both probes need only a call to it. No new mechanism.

F2 — LOW: a false test failure on Windows developer hosts that have a pip install --user copy of kirocrew.exe. The test stubs only sys.executable and never _user_scripts_dir(), which gateway_command() still checks. The sibling fallback test in the same patch already stubs it.
The fix is one monkeypatch.setattr line the file already uses, and it adds no maintenance load. Downgrading is not justified when the fix costs this little.

[ADJUDICATION] 0198bcce8dda240eb87e8e034f85f15dd2b689e7 total=2 uphold=2 downgrade=0
UPHOLD F1 src/kiro_crew/service/windows.py:839 reason=harm-warrants-remedy
UPHOLD F2 test/test_service_windows.py:498 reason=harm-warrants-remedy
[GPT-ADJUDICATED] 0198bcce8dda240eb87e8e034f85f15dd2b689e7

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 16, 2026
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — 🔴 changes requested (blocking)

Reviewed 0198bcce8dda240eb87e8e034f85f15dd2b689e7 via the fork AI-review pipeline; updated in place on each push.

kirocrew restart on Windows quietly disables the Task Scheduler task when a foreground gateway holds the port, which turns supervision off with no message to the operator.

BLOCKING — src/kiro_crew/service/controller.py:304

return RestartReport(unmanaged_gateway=True)

Trigger: The operator runs kirocrew service install while a foreground gateway is serving. install()/start() leave the task enabled, and each tick's instance loses the lock. Later the operator runs kirocrew restart. restart_service → windows.restart() sees the port stay held after /End and returns None, so the controller returns unmanaged_gateway. _restart then takes the foreground branch and calls _stop(None) (cli_server_restart.py:865). That calls service_controller.stop_service() (cli_server_stop.py:409) → windows.is_installed() is True → windows.stop() runs /Change /DISABLE.
Outcome: The restart() docstring says "Nothing is changed in that case", but the restart leaves the supervisor disabled. The replacement gateway is unsupervised, the next loop-stall watchdog termination is never recovered, and nothing tells the operator. service status still reports the task as installed.
Anchor: defect
Fix: When the report says unmanaged_gateway, make the foreground restart path skip stop_service(). For example, give _stop a flag that bypasses the service short-circuit, as it already does for an explicit --port. Alternatively, record the task's enabled state before the stop and restore it afterwards.

[BLOCK-MERGE] 0198bcc
[OPUS-REVIEWED] 0198bcc

@GoZippy
GoZippy force-pushed the feat/windows-task-scheduler-service branch from 12e009b to 4e83fcf Compare September 16, 2026 13:03
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 16, 2026
@GoZippy
GoZippy force-pushed the feat/windows-task-scheduler-service branch from 4e83fcf to e303e07 Compare September 16, 2026 13:24
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 16, 2026
@GoZippy
GoZippy force-pushed the feat/windows-task-scheduler-service branch from e303e07 to 9118db8 Compare September 16, 2026 13:39
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 16, 2026
@GoZippy
GoZippy force-pushed the feat/windows-task-scheduler-service branch from 9118db8 to bb4a13a Compare September 16, 2026 13:46
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Oct 22, 2026
@bolichen97
bolichen97 force-pushed the feat/windows-task-scheduler-service branch from 4a1d532 to e6a8de3 Compare October 22, 2026 21:26
@bolichen97

bolichen97 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

self-added: no

  • span=bffdaec467c5 Fresh installs do not activate repeating supervision

fixed in e6a8de3: the task carries a TimeTrigger whose StartBoundary is the install time, with the same PT1M repetition and no Duration, so supervision is armed at registration; the LogonTrigger re-arms it after each sign-in and IgnoreNew drops overlapping ticks.
same span, second finding (query failures read as removal): fixed in e6a8de3. A non-zero /Query /TN is checked against the full task list, whose TaskName column is the task path and is never localized. A refused list raises, a list naming the task raises, and only an answered list without it is absence, so uninstall can no longer report a removal of a task that stays.

@bolichen97

bolichen97 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
  • span=9c923c4bfc3c The documented stop command is rejected before stopping anything

fixed in e6a8de3: the Windows guide row names the commands that exist, kirocrew service install / status / uninstall and kirocrew stop / restart, and says kirocrew stop disables the task and kirocrew restart re-enables it.

@bolichen97

bolichen97 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
  • span=82df3a968682 A restart claims a foreground gateway and re-arms a stopped task

fixed in e6a8de3: windows.restart() probes the port, runs /End, and when the port is still served after a bounded wait it returns None without /ENABLE or /Run; restart_service() turns that into an empty RestartReport so the foreground path restarts the gateway that actually serves.
same span, second finding (status exits 0 with no task): fixed in e6a8de3. service_status() exits 0 only when is_installed() and is_active() both hold, matching systemd and launchd where a missing unit exits 1.

@bolichen97

Copy link
Copy Markdown
Contributor

Readback copy: kept. It is the only on-disk record of what was registered, the module warning tells an operator hitting an unproven Task Scheduler build to read it, and install writes it before /Create and removes it when registration fails, so it never describes a task that does not exist.
RestartOnFailure: kept. It covers the one failure the triggers do not, an action the scheduler could not launch, and its count stays bounded at 3; the repeating triggers remain what recovers a watchdog termination.

@bolichen97

Copy link
Copy Markdown
Contributor

Agreed with the PASS. The ask to confirm on a second Windows build stays open: CI runs no live Task Scheduler, so it is listed under Manual verification as unverified, for a maintainer with a Windows 11 or Server host.

@bolichen97
bolichen97 force-pushed the feat/windows-task-scheduler-service branch from e6a8de3 to ddbe30b Compare October 22, 2026 21:59
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 22, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=ed01a76b3bcd Installed task vetoes the foreground restart fallback

fixed in 23dc7dc: when windows.restart() finds the port served by a gateway the task does not own, restart_service() returns RestartReport(unmanaged_gateway=True), and _restart() skips the is_service_active() refusal for that report, so the foreground path restarts the serving gateway.
covered by test_a_gateway_the_task_does_not_own_takes_the_foreground_path in test/test_cli_restart.py.

@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=bffdaec467c5 Liveness probes the wrong port for a configured dashboard

fixed in 23dc7dc: windows.is_active() now probes resolve_client_port(None), the resolver the other client verbs use, so KIROCREW_PORT and a dashboard.url port are followed; test_an_operator_port_override_is_probed pins it.
same span, browser tab finding: fixed in 23dc7dc. gateway_command() appends --no-open to both the console script and the module fallback, matching the systemd unit and the launchd plist.
same span, unrelated listener finding: rebutted as disproportional, as adjudication already downgraded it. A foreign listener on the dashboard port makes the gateway fail to bind, which gateway.log shows, and snapshot.py accepts the same connect probe as gateway liveness. An identity probe used only by this backend would add more than the goal needs.

@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=82df3a968682 Restart exits 1 instead of restarting a foreground gateway beside a stopped task

fixed in 23dc7dc: the empty report from a not owned gateway now carries unmanaged_gateway=True and _restart() skips the installed-service refusal for it, so the foreground gateway is restarted.
scheduler error branch: kept on purpose. When schtasks cannot answer, ownership is unknown, and refusing is safer than spawning a second gateway beside a task that may own the port.
service status beside a foreground gateway: kept. It prints that the task is installed and a gateway is running, which is true, and exits 0 because a gateway serves.

@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=4a5a4fef02e9 Gateway checks probe a port the gateway may not be bound to

fixed in 23dc7dc: windows.is_active() resolves the port through port_resolution.resolve_client_port(None) instead of the import time DASHBOARD_PORT, so status, stop and restart probe the port the gateway binds, including a dashboard.url port. Pinned by test_an_operator_port_override_is_probed.

@bolichen97

Copy link
Copy Markdown
Contributor

Agreed with the PASS. Supervision stays on the repeating trigger with IgnoreNew. A second Windows build (11 or Server) is still listed under Manual verification as unverified, for a maintainer with such a host.

@bolichen97

Copy link
Copy Markdown
Contributor

Agreed with the PASS. The backend stays opt in and the defaults are unchanged. The readback copy is kept as the only on disk record of what was registered, as answered on the previous head; the fixes in 23dc7dc add no new mechanism beyond the port resolver call, the --no-open flag and one report field.

@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=4a5a4fef02e9 The install guard reads only the user key, unexpanded

fixed in d1c6b10: _persisted_override() reads the user Environment key, falls back to the machine Session Manager Environment key when the user has no value, and expands a REG_EXPAND_SZ value with ExpandEnvironmentStrings before the comparison, which is how a logon session builds the environment the task inherits.
an unreadable key at either level still fails closed. New tests in test/test_service_windows.py cover expansion, a plain value left as is, the machine fallback, user precedence, unset everywhere, and an unreadable machine key.

@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=bffdaec467c5 Failed registration republishes protected credentials

fixed in 0198bcc: install() reads the prior readback copy through safe_read_file_bytes_nolink, contained to the readback directory and capped at 256 KiB.
a link, junction, hardlinked inode, sensitive path or oversized file at that name now stops the install before anything is written or registered, so no bytes from a link target can be republished.
tests in test/test_service_windows.py cover a symlink, a hardlink and an oversized file, plus a reinstall over the real data home copy.

@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=bffdaec467c5 User-site installations cannot launch the scheduled gateway

fixed in 0198bcc: gateway_command() also checks the per-user Scripts directory from the nt_user install scheme, which is where pip install --user writes kirocrew.exe, before the isolated module fallback.
the console script imports the package from the user site, so the task starts; the fallback is reached only when no console script exists anywhere this interpreter installs one.
tests cover the user script being chosen, the interpreter adjacent one winning, and an unknown scheme.

@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=bffdaec467c5 Relative data-home overrides change the supervised home

fixed in 0198bcc: install refuses a relative KIROCREW_HOME, drive relative and rooted forms included, before rendering or registering, and prints the absolute setx command to use instead.
the check runs ahead of the both directions comparison, since equal relative strings pass that one.
tests cover a persisted relative override refusing with no scheduler call and an absolute one passing.

@bolichen97

Copy link
Copy Markdown
Contributor

self-added: no

  • span=bffdaec467c5 Restart and status report success without a healthy gateway

fixed in 0198bcc: new is_serving() needs the run marker for the port to name a live pid and /api/ready to answer 200; status() and service status use it, so another program on the port no longer reads as running.
restart_service() now waits up to 60 s for is_serving() after /Run is accepted, and reports RESTART_NOT_UP with kirocrew logs as the hint when the gateway never gets ready, as the systemd path does for a unit that does not stay up.
stop keeps the plain port probe, since there the question is whether anything still holds the port. Tests in both service test files.

@bolichen97

Copy link
Copy Markdown
Contributor

The reds on d1c6b10 are not caused by this change:

A new head is pushed with the review fixes, so all of these run again.

@GoZippy

GoZippy commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Validated the Windows log fallback at the current PR head (0198bcc) against upstream/main 341d05c. _logs_cmd now selects the Python reader for both SCHTASKS and UNSUPPORTED, and test_windows_logs_read_utf8_tail_without_external_binary passes both Windows parameter cases (2 passed). This review request is addressed in the current head; the checks currently shown on this PR last ran Oct 23 and still need a fresh run/review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge needs-author-decision PR blocked on author input readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants