Spaces:
Sleeping
Sleeping
Commit History
-
chore: boot Space paused during experiment phase
Add START_PAUSED env var support in server.ts. When START_PAUSED=1, agent loop comes up idle and waits for /api/resume. Set it in the Dockerfile so the deployed Space stops hammering the shared runpod endpoint while we run controlled experiments locally. Resume via the browser when the Space should run again. Local dev unaffected (env unset → unpaused as before). Also: - engine.js: SinglePlayerGame now accepts a {seed} option using a mulberry32 PRNG so eval runs are reproducible across variants. - agent-brain.js: buildPickFirstPrompt and analyzeViewport now take an optional radius (default 4 = 9×9). Allows variant sweeps. - eval.ts (new): headless agent benchmark. Takes --variant --seed --turns and emits one JSON metrics object per run. Variants in VARIANTS map (baseline, viewport_5, viewport_13, temp_0/high, thinking_on, cache_on). Captures: diamonds/N, realActionRate, illegalMoveRate, pickPrecision, directionEntropy, medianLatency, cacheHitRate, full per-turn token s…327ab12 -
fix: no-op the turn on inference failure instead of random walk
Prior behavior: when callModel failed (HTTP error after retries) or returned no usable tool_call, randomFallbackAction() picked a uniform- random direction and the agent moved. This meant the agent's body wandered randomly while the brain had no memory of those moves — fallbacks were invisible to memory because tool_call_id was null. The action histogram looked balanced because of these random-walk turns, masking the model's actual decision distribution. New behavior: on fallback, do nothing. - Snapshot memory.messages.length at the top of each iteration; if no usable action comes back, popLast() until we're back to that depth. Cleans up both an orphan user message (HTTP error path) and an empty assistant turn (no-tool_calls path). - Don't move the agent, don't push to actionLog, don't emit tool_execution_start/end. Just log fallback_action + turn_end and loop. - The agent stays in place. Next iteration rebuilds the same prompt fresh — the runpod LB may pick a healthier sl…700271c -
feat: pi-mono compliant NDJSON traces, debug API, illegal-move rule, red dots
Several related changes that came up while debugging a "constant fallback" state on the live deploy. Game rules: - engine.js: moving onto a tile with a pickable object now throws "Cannot move onto <emoji> — use pick <dir> instead". Forces the model to choose the right tool; the error string self-corrects via the tool result fed back next turn. - agent-brain.js: drop the LEGAL_ACTIONS line and the diamond-adjacent warning from buildPickFirstPrompt — the engine error + tool/system prompt descriptions now carry the constraint. Update tool descriptions and system prompt to match (move fails on diamonds, pick is the way). - index.html: failed actions now render with a red dot in the action history (was always green/blue regardless of outcome). Server-side robustness: - server.ts: cache_prompt:true broke on the upstream llama.cpp build (b9038-2ca1161bd) once a slot accumulated >n_ctx of stale cache. callModel now retries without cache_prompt on "Context size has been ex…c8de5f5
-
chore: aggressive cleanup — keep only the browser harness
The repo started as a research project with a multi-agent REST API, ONNX-based eval scripts, a CLI agent client, and several test suites. The shipped browser harness now hits a remote llama.cpp endpoint directly and has no need for any of that infrastructure. Drop it. Removed: - server.ts, gameState.ts, aiService.ts (legacy multi-agent REST API) - middleware/, types.ts, agent-client.ts, replay.html - API.md, openapi.yaml (REST API docs) - __tests__/ entire directory: 10 ai-eval scripts (~1500 LOC) + their result JSONs, plus the e2e/integration/unit test suites for the multi-agent server - Dockerfile, package.json, bun.lockb (no runtime deps anymore) Slimmed: - engine.js: 481 → 175 LOC. Drops the prompt-building helpers (SYS_PROMPT, FEW_SHOT, buildUserPrompt, buildMessages, MCQ_*, getAdjacencyFromViewport, parseAction, isValidAction), the pixel-buffer renderers (renderMapToRGBA, renderAnnotatedMapToRGBA, EMOJI_COLOURS), and unexports the world-gen internals. Public surface…49df1c0 -
docs: refresh README; drop dup AVATAR_EMOJIS from engine.js; commit pending image renderers
- README.md: update to match the current codebase. Document the remote-only Qwen3.6-27B browser harness (cache_prompt, structured tool calling, LLM-summarization compaction). Refresh Architecture, Agent Brain exports, URL params, eval scripts table. Drop sections that referenced deleted multiturn evals. - engine.js: drop the duplicate AVATAR_EMOJIS export. The canonical list is in types.ts and that's what every consumer imports. - engine.js: commit the pending renderMapToRGBA / renderAnnotatedMapToRGBA / EMOJI_COLOURS additions used by the vision eval scripts (tool-calling-eval.ts, tool-calling-v2-eval.ts).a04dc2b -
chore: squash pre-2026-05-06 history
Initial mini-world snapshot at c0da002 — collapses 25 commits of research and feature work into a single root: - single-player game engine (Perlin world gen, viewport rendering, image rendering for vision evals) - in-browser ONNX agent with pick_first strategy and 5 alternative prompting strategies for evals - multi-agent REST API server with auth, rate limiting, and SSE - 10 eval scripts comparing prompt strategies, tool calling, vision, and context compaction at 0.8B/2B/4B - agent-client.ts CLI for autonomous play against the API - replay viewer for recorded eval sessions The squashed history is preserved in reflog locally; for the public record this is the starting point that the remote-only harness + compaction work builds on.e208045