-
Notifications
You must be signed in to change notification settings - Fork 805
Add shared sentinel arena rollout Gene #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cb9c1cd
850b19c
4d51b8c
6d6fcba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | ||
| "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>Label</key> | ||
| <string>com.evomap.evolver</string> | ||
| <key>ProgramArguments</key> | ||
| <array> | ||
| <string>/usr/local/bin/node</string> | ||
| <string>/usr/local/lib/node_modules/@evomap/evolver/index.js</string> | ||
| <string>--loop</string> | ||
| </array> | ||
| <key>RunAtLoad</key> | ||
| <true/> | ||
| <key>KeepAlive</key> | ||
| <true/> | ||
| <key>StandardOutPath</key> | ||
| <string>/tmp/evomap-evolver.out.log</string> | ||
| <key>StandardErrorPath</key> | ||
| <string>/tmp/evomap-evolver.err.log</string> | ||
| </dict> | ||
| </plist> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| [Unit] | ||
| Description=EvoMap Evolver daemon | ||
| After=network-online.target | ||
|
|
||
| [Service] | ||
| Type=notify | ||
| Environment=EVOMAP_PROXY=1 | ||
| Environment=EVOMAP_PROXY_TRACE=metadata | ||
| Environment=EVOMAP_PROXY_TRACE_FILE=%h/.local/state/evomap/proxy-traces.jsonl | ||
| WorkingDirectory=%h | ||
| ExecStart=/usr/bin/env node %h/.npm-global/lib/node_modules/@evomap/evolver/index.js --loop | ||
| Restart=on-failure | ||
| RestartSec=5 | ||
| WatchdogSec=60 | ||
| StandardOutput=journal | ||
| StandardError=journal | ||
| # proxy_trace_failed_once is emitted by the proxy trace writer when local trace | ||
| # persistence is unavailable; journald captures it for diagnostics. | ||
|
|
||
| [Install] | ||
| WantedBy=default.target |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| param( | ||
| [ValidateSet('metadata', 'full', 'off')] | ||
| [string]$TraceMode = 'metadata', | ||
| [string]$TraceFile = "$env:LOCALAPPDATA\EvoMap\proxy-traces.jsonl" | ||
| ) | ||
|
|
||
| $launcherDir = Join-Path $env:LOCALAPPDATA 'EvoMap' | ||
| $launcherDir = Join-Path $launcherDir 'Evolver' | ||
| New-Item -ItemType Directory -Force -Path $launcherDir | Out-Null | ||
| $launcherPath = Join-Path $launcherDir 'evolver-loop.vbs' | ||
|
|
||
| $traceModeEsc = $TraceMode.Replace('"', '""') | ||
| $traceFileEsc = $TraceFile.Replace('"', '""') | ||
| $node = (Get-Command node).Source.Replace('"', '""') | ||
| $index = "$PSScriptRoot\..\index.js".Replace('"', '""') | ||
|
|
||
| $launcherBody = @" | ||
| Set WshShell = CreateObject("WScript.Shell") | ||
| Set env = WshShell.Environment("PROCESS") | ||
| env("EVOMAP_PROXY") = "1" | ||
| env("EVOMAP_PROXY_TRACE") = "$traceModeEsc" | ||
| env("EVOMAP_PROXY_TRACE_FILE") = "$traceFileEsc" | ||
| cmd = """$node"" ""$index"" --loop" | ||
| result = WshShell.Run(cmd, 0, True) | ||
| "@ | ||
| Set-Content -Path $launcherPath -Value $launcherBody -Encoding Unicode | ||
|
|
||
| $action = New-ScheduledTaskAction -Execute 'wscript.exe' -Argument "`"$launcherPath`"" | ||
| $settings = New-ScheduledTaskSettingsSet -RestartCount 5 -RestartInterval (New-TimeSpan -Minutes 1) | ||
| Register-ScheduledTask -TaskName 'EvoMap Evolver' -Action $action -Settings $settings -Force | Out-Null | ||
| Write-Host "Installed EvoMap Evolver scheduled task." | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| param( | ||
| [string]$Settings = "$HOME\.evolver\settings.json", | ||
| [switch]$PrintSensitiveEnv | ||
| ) | ||
|
|
||
| function Test-NonEmptyString($Value) { | ||
| return ($Value -is [string]) -and (-not [string]::IsNullOrWhiteSpace($Value)) | ||
| } | ||
|
|
||
| function Warn-ExistingAnthropicApiKey { | ||
| if (Test-NonEmptyString $env:ANTHROPIC_API_KEY) { | ||
| Write-Warning 'ANTHROPIC_API_KEY is already set in this PowerShell session; internal-proxy-env.ps1 does not overwrite it.' | ||
| } | ||
| } | ||
|
|
||
| $settingsJson = Get-Content -Raw -Path $Settings | ConvertFrom-Json | ||
| $proxy = $settingsJson.proxy | ||
| if ((-not (Test-NonEmptyString $proxy.url)) -or (-not (Test-NonEmptyString $proxy.token))) { | ||
| throw 'no active string proxy.url/proxy.token in settings' | ||
| } | ||
|
|
||
| Warn-ExistingAnthropicApiKey | ||
| $proxyUrl = $proxy.url.TrimEnd('/') | ||
| $proxyToken = $proxy.token | ||
| $env:ANTHROPIC_BASE_URL = "$proxyUrl/v1" | ||
| $env:ANTHROPIC_AUTH_TOKEN = $proxyToken | ||
|
|
||
| if ($PrintSensitiveEnv) { | ||
| Write-Output "`$env:ANTHROPIC_BASE_URL = '$($env:ANTHROPIC_BASE_URL)'" | ||
| Write-Output "`$env:ANTHROPIC_AUTH_TOKEN = '$proxyToken'" | ||
| } else { | ||
| Write-Host "EvoMap Proxy environment applied for $proxyUrl" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| settings_file="" | ||
| codex_config=0 | ||
|
|
||
| while [ "$#" -gt 0 ]; do | ||
| case "$1" in | ||
| --settings) | ||
| if [ "$#" -lt 2 ]; then | ||
| echo "internal-proxy-env: missing value for --settings" >&2 | ||
| exit 2 | ||
| fi | ||
| settings_file="$2" | ||
| shift 2 | ||
| ;; | ||
| --codex-config) | ||
| codex_config=1 | ||
| shift | ||
| ;; | ||
| *) | ||
| echo "internal-proxy-env: unknown argument: $1" >&2 | ||
| exit 2 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| node_bin="${NODE:-node}" | ||
| script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| repo_root="$(cd "$script_dir/.." && pwd)" | ||
| index_js="$repo_root/index.js" | ||
|
|
||
| url="$("$node_bin" -e ' | ||
| const fs = require("fs"); | ||
| const file = process.argv[1]; | ||
| const parsed = JSON.parse(fs.readFileSync(file, "utf8")); | ||
| const url = parsed && parsed.proxy && parsed.proxy.url; | ||
| if (typeof url !== "string" || !url.trim()) process.exit(1); | ||
| process.stdout.write(url.replace(/\/+$/, "")); | ||
| ' "$settings_file")" | ||
|
|
||
| if [ "$codex_config" -eq 1 ]; then | ||
| printf '[model_providers.evomap_proxy]\n' | ||
| printf 'name = "EvoMap Proxy"\n' | ||
| printf 'base_url = "%s/v1"\n' "$url" | ||
| printf 'wire_api = "responses"\n' | ||
| printf 'env_key = "ANTHROPIC_AUTH_TOKEN"\n' | ||
| printf 'env_key_command = { command = %s, args = [%s, %s, %s] }\n' \ | ||
| "$(node -p 'JSON.stringify(process.execPath)')" \ | ||
| "$(node -p 'JSON.stringify(process.argv[1])' "$index_js")" \ | ||
| "$(node -p 'JSON.stringify("proxy-token")')" \ | ||
| "$(node -p 'JSON.stringify("--settings")'), $(node -p 'JSON.stringify(process.argv[1])' "$settings_file")" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codex env_key_command args malformedMedium Severity The Reviewed by Cursor Bugbot for commit 6d6fcba. Configure here. |
||
| exit 0 | ||
| fi | ||
|
|
||
| printf 'export ANTHROPIC_BASE_URL=%q\n' "$url/v1" | ||
| printf 'export ANTHROPIC_AUTH_TOKEN="$("%q" "%q" proxy-token --settings "%q")"\n' "$node_bin" "$index_js" "$settings_file" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| 'use strict'; | ||
|
|
||
| function determineBridgeEnabled(env) { | ||
| const source = env || process.env; | ||
| const raw = source.EVOLVE_BRIDGE; | ||
| if (raw !== undefined && String(raw) !== '') { | ||
| return String(raw).toLowerCase() !== 'false'; | ||
| } | ||
| return !!String(source.OPENCLAW_WORKSPACE || '').trim(); | ||
| } | ||
|
|
||
| module.exports = { determineBridgeEnabled }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| 'use strict'; | ||
|
|
||
| function resolveLoopBridgeMode(env) { | ||
| const source = env || process.env; | ||
| if (!source.EVOLVE_BRIDGE) { | ||
| source.EVOLVE_BRIDGE = 'true'; | ||
| } | ||
| const value = String(source.EVOLVE_BRIDGE); | ||
| const enabled = value.toLowerCase() !== 'false'; | ||
| return { | ||
| value, | ||
| enabled, | ||
| banner: enabled | ||
| ? [ | ||
| '[Daemon] EVOLVE_BRIDGE=true (default since v1.85.0).', | ||
| '[Daemon] evolver may modify your working tree.', | ||
| '[Daemon] Failed cycles auto-stash via "git stash push --include-untracked".', | ||
| '[Daemon] Recover: git stash list | grep evolver-rollback', | ||
| '[Daemon] Set EVOLVE_BRIDGE=false to opt out (observe-only mode).', | ||
| ] | ||
| : [ | ||
| '[Daemon] EVOLVE_BRIDGE=false: evolver will NOT modify your working tree (observe-only).', | ||
| '[Daemon] To enable real evolution: unset EVOLVE_BRIDGE or set it to "true".', | ||
| ], | ||
| }; | ||
| } | ||
|
|
||
| module.exports = { resolveLoopBridgeMode }; |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows task lacks startup trigger
Medium Severity
Register-ScheduledTaskregisters the EvoMap Evolver action and restart settings but no-Trigger(for example at logon). The task is created yet never starts automatically, unlike the macOS plistRunAtLoadand typical daemon install expectations after running the installer.Reviewed by Cursor Bugbot for commit 6d6fcba. Configure here.