Skip to content

fix(terminal): cross-platform compatibility for LocalEnvironment on Windows - #181

Closed
dogiladeveloper wants to merge 8 commits into
NousResearch:mainfrom
dogiladeveloper:fix/local-environment-cross-platform
Closed

fix(terminal): cross-platform compatibility for LocalEnvironment on Windows#181
dogiladeveloper wants to merge 8 commits into
NousResearch:mainfrom
dogiladeveloper:fix/local-environment-cross-platform

Conversation

@dogiladeveloper

Copy link
Copy Markdown
Contributor

Problem

tools/environments/local.py uses three POSIX-only APIs that crash
on Windows with AttributeError:

  • os.setsid() — passed as preexec_fn to subprocess.Popen
  • os.getpgid(proc.pid) — in interrupt and timeout paths
  • os.killpg(pgid, signal) — in interrupt and timeout paths

CONTRIBUTING.md lists cross-platform compatibility as priority #2.

Changes

tools/environments/local.py

  • _IS_WINDOWS = platform.system() == "Windows" detected at import
  • New _kill_process_tree(proc, *, force=False) helper:
    POSIX: os.getpgid + os.killpg(SIGTERM/SIGKILL), falls back to
    proc.terminate()/proc.kill() on PermissionError
    Windows: proc.kill() directly, no preexec_fn, no killpg
  • Split subprocess.Popen call by platform:
    POSIX: [shell, "-lic", command] + preexec_fn=os.setsid (unchanged)
    Windows: ["cmd.exe", "/C", command] — preexec_fn not passed
  • All os.killpg calls replaced with _kill_process_tree()

No behaviour change on Linux or macOS.

Testing

New file: tests/tools/test_local_environment.py

pytest tests/tools/test_local_environment.py -v

Checklist

  • Existing tests pass
  • No behaviour change on Linux/macOS
  • Windows path tested via mock (_IS_WINDOWS=True patch)
  • CONTRIBUTING.md cross-platform guidelines followed

@dogiladeveloper
dogiladeveloper deleted the fix/local-environment-cross-platform branch March 2, 2026 11:28
teddyjfpender added a commit to teddyjfpender/superforecasting-agent that referenced this pull request Jun 28, 2026
The market-hidden arm ran (245 cases): the closed-book agent has NO intrinsic edge — Brier 0.279 vs
market 0.164 (loses by 0.115), OVER-confident (SCE +0.20, worse than a base rate), simplex weight
0.000→0.031 but CI still includes 0 and beats_both=False.

- Grounding study: new §3.4 (the head-to-head table + the over-confidence finding), abstract + §4
  interpretation updated (the visible-arm skill was borrowed anchoring; the edge must be manufactured
  by the harness from fresh information, proven out-of-sample on future-resolving markets), §6.1
  resolved (Gate-2 NousResearch#181 is the next step; de-extremize-when-uninformed noted).
- Strategy §5: EMPIRICAL UPDATE recording that closed-book Lever A fails the falsification test — but
  it is the NO-SEARCH FLOOR, so it proves the precondition (parametric knowledge carries no edge) and
  makes Lever B (search, NousResearch#181) the ONLY lever, not merely the largest. Informed-A1 thesis still open.
teddyjfpender added a commit to teddyjfpender/superforecasting-agent that referenced this pull request Jun 28, 2026
…fresh-search loop

The market-hidden experiment proved the closed-book LLM has no intrinsic edge, so the ONLY
path to beating the market is fresh information it hasn't priced. P1.1 built the run_quorum
search seam; this wires a real one into the live quorum path.

- NEW supervisor_search.py: build_supervisor_search_runner — a bounded (max 3 queries x 5
  results, dedup, total cap 12) Callable that runs the agent's real web/news search for the
  judge's clarifying queries and reshapes rows into evidence dicts (available_at=now). Robust:
  a failing backend yields [] (never throws). Drops P2.4 leak-domain hosts so a settlement/
  odds-widget URL can't be folded into the panel/judge context.
- quorum_jobs.execute_job builds + passes the search_runner, GATED behind spec.supervisor_search
  (forecast quorum --supervisor-search) or the quorum.supervisor_search config flag; DEFAULT OFF
  => byte-identical (research_rounds 0). When on, the judge can trigger one fresh-search round.

Review fix (MAJOR leakage seam): the search is now disabled in CODE for a HISTORICAL
evidence_cutoff (_cutoff_is_live) — fresh present-day search cannot be pinned to a past cutoff,
so a backtest/replay snapshot can never fold post-cutoff info into a past-pinned forecast (the
no-leak invariant is enforced, not left to convention). Plus: clamp research rounds at 3, the
leak-domain filter above, and corrected docstrings (the config flag governs the quorum path, not
market-nightly). Full forecasting + quorum suite: 1556 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
abhibansal-sg referenced this pull request in abhibansal-sg/hermes-agent-fork Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant