Spaces:
Runtime error
Runtime error
Commit History
-
feat: stream Claude Code output to conv-loop log with [CC] prefix
- Replace subprocess.run(capture_output) with Popen streaming, so each line of Claude Code output appears in real-time with [CC] prefix - Add [CC-RESULT] summary (800 chars) after each claude_code action - Both opening turn and do_turn() now log CC results Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8a21cd0 -
feat: add delete_env action + collision auto-detection
- Add [ACTION: delete_env:KEY] to delete env vars that collide with secrets - action_get_env() now detects and flags variable/secret name collisions - System prompt teaches agents to use delete_env for CONFIG_ERROR fixes - This is the correct fix: OPENAI_API_KEY exists as both Variable and Secret Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ddef022 -
refactor: conversation-loop v2 — Claude Code as primary executor
Complete architecture change: - OLD: GLM picks from 15+ actions, manually reads files/writes code (badly) - NEW: GLM discusses situation → outputs [TASK] for Claude Code → Claude Code clones repo, analyzes, fixes, pushes autonomously Key changes: - gather_context() auto-collects health, env, files each turn - System prompt teaches agents they're "project managers", not coders - parse_and_execute_turn() routes [TASK] blocks to action_claude_code() - Removed: sub-agent delegation, emoji parser, 5-state machine, knowledge dedup, ACT-phase guard, write dedup — all replaced by Claude Code - Added: CONFIG_ERROR knowledge (HF env var / secret name collision) - Kept: cooldown, building-state guard, chatlog, persistence, bilingual output 885 lines (was 1630, -45%) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>f3f1288 -
fix: use --user flag for pip install (non-root container)
Container runs as node user, not root. pip install without --user can't write to system site-packages. Also log pip result for debugging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5c981dd -
fix: install requests at runtime before launching conversation-loop
Dockerfile layer cache may not pick up the new dependency. Install requests via pip at runtime as a fallback to guarantee availability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>f532fc8 -
feat: add /api/conv-loop-log endpoint for remote diagnostics
token-redirect.cjs: serve last 50 lines of conversation-loop.log via GET /api/conv-loop-log for remote monitoring without container access. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8d482fd -
feat: run conversation-loop on Home Space cloud + CONFIG_ERROR fixes
- sync_hf.py: auto-launch conversation-loop.py on OFFICE_MODE=1 (Home Space) with 60s startup delay, auto-restart on crash, graceful shutdown - conversation-loop.py: add claude_code action for Claude Code CLI integration - conversation-loop.py: fix CONFIG_ERROR not clearing write dedup, cooldown, and state transitions (was only handling RUNTIME_ERROR/BUILD_ERROR) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>acab3db -
feat: integrate Claude Code as coding-agent backend (z.ai/Zhipu GLM)
Replace custom HF API tools with Claude Code CLI sub-agent. The extension now spawns `claude -p` with ANTHROPIC_BASE_URL=api.z.ai to autonomously clone, analyze, fix, and push code changes to HF Spaces. - Dockerfile: install @anthropic-ai/claude-code globally - index.ts: 3 tools (claude_code, hf_space_status, hf_restart_space) - sync_hf.py: add ZAI_API_KEY env var passthrough - plugin.json: add zaiApiKey config field, bump to v2.0.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d653b4e -
feat: add coding-agent OpenClaw extension with 8 HF Space tools
New extension at extensions/coding-agent/ that registers tools directly into OpenClaw's agent runtime, giving Adam & Eve real coding capabilities: Tools registered: - hf_read_file: Read files from Space/Dataset - hf_write_file: Write files with auto Python syntax validation - hf_delete_file: Delete files from repos - hf_list_files: List all files in a repo - hf_space_status: Check Space health/stage - hf_restart_space: Restart the target Space - hf_search_code: Grep-like regex search across code files - python_syntax_check: Validate Python syntax before committing Key features: - Python .py files are syntax-checked BEFORE writing (prevents the blind-write-then-wait-for-build-failure loop) - Configured via CODING_AGENT_TARGET_SPACE/DATASET env vars - Follows A2A gateway extension pattern (registerTool API) Also adds: - workspace-templates/ with IDENTITY.md and SOUL.md for coding agent behavior (deployed on first boot if workspace files are default) - Dockerfile updated to COPY ex…b44dfca -
fix: clear write dedup when Cain is RUNNING but API unresponsive
files_written_this_cycle only cleared on API success or BUILD/RUNTIME_ERROR, but never when stage=RUNNING with unresponsive API. This permanently blocked agents from re-writing files to fix issues, causing them to spin for 17+ turns unable to apply their code fixes. Now clears dedup on RUNNING state too, so agents can iterate on fixes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>7a1ef1c -
feat: persist Adam & Eve conversation to HF Dataset
Every turn is saved as a JSONL record to tao-shen/HuggingClaw-Home-data at conversation-log/chatlog.jsonl. Records include timestamp, speaker, bilingual text, actions with results, workflow state, and child stage. - Buffer 3 turns then flush to HF Dataset (reduces API calls) - Also writes to /tmp/conversation-loop-full.jsonl as local backup - Flushes on SIGTERM/exit so no data lost when process is killed - Re-buffers on flush failure to prevent data loss Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b447519 -
fix: move global declaration to function top to fix SyntaxError
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1956abb -
fix: defer cooldown to end of turn so agents can batch file ops
Previously, each write/delete to Space immediately activated the rebuild cooldown, blocking subsequent file ops in the SAME turn. This caused agents to self-lock: delete requirements.txt (cooldown starts) → can't write app.py. Now cooldown activates AFTER all actions in a turn complete, allowing agents to atomically modify multiple files (e.g., delete + write) in one turn. Also adds delete_file to cooldown guard — it was previously unguarded, letting agents trigger unlimited rebuilds via deletions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>42eb3e9 -
feat: add delete_file action so agents can remove conflicting files
Agents couldn't delete Dockerfile when switching to sdk:gradio mode, causing persistent BUILD_ERROR. Now they can use: [ACTION: delete_file:space:Dockerfile] [ACTION: delete_file:dataset:PATH] Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>00e404d -
fix: add sdk:gradio vs sdk:docker warning — Dockerfile ignored in gradio mode
Agents kept writing Dockerfile fixes (pip uninstall, FROM python:3.X) that had zero effect because README.md has sdk:gradio, which makes HF ignore Dockerfile entirely. Added explicit warning to check sdk field first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>2291ba7 -
fix: add pip uninstall hint for cached deps + torch OOM warning
Agents kept hitting pydub error even after removing from requirements.txt because Docker cached it. Added: 1) pip uninstall trick for stubborn deps, 2) grep code for imports, 3) warning against torch/transformers on free tier. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b85abe9 -
fix: add HF Docker cache override warning + retry strategy rule
Agents were stuck in a loop rewriting Dockerfile to change Python version (4+ times) while HF Spaces kept ignoring the base image change. Added: 1. Warning that HF may override Python version in base image 2. Rule: if same fix fails 3+ times, change strategy (remove dep, not env) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>39d732e -
fix: prevent wasted actions from Chinese action names in LLM output
GLM-4.5 sometimes translates action syntax to Chinese in the Chinese section (e.g. [ACTION: 写入文件:空间:PATH]), wasting 50% of actions. Added explicit rule that action syntax must be English only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>6ee803b -
fix: fetch runtime logs in check_health when RUNNING but API unresponsive
Agents were blind-guessing why Cain's API wasn't responding because check_health only returned "Running but API not responding" with no logs. Now fetches last 10 lines of runtime logs, giving agents concrete errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>f1156b1 -
fix: add HF Spaces port 7860/Gradio constraint to agent system prompt
Agents were removing gradio from requirements.txt thinking it caused OOM, but HF Spaces requires port 7860 binding (via Gradio) to transition from APP_STARTING to RUNNING. Without this knowledge, agents go in circles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>4653fc1 -
fix: allow write_file during APP_STARTING so agents can fix stuck startups
APP_STARTING was incorrectly grouped with BUILDING/RESTARTING in write-blocking guards. During BUILDING, writes reset the build. But during APP_STARTING, writes trigger a NEW build — which is exactly what agents need to fix a stuck startup (e.g. wrong entrypoint, blocking restore script, missing deps). This caused agents to diagnose the problem correctly but be unable to apply fixes, wasting entire grace periods on read-only diagnostics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8cab3f9 -
fix: add grace period after smart-wait timeout for consecutive agent turns
After timeout, agents got only 1 turn before re-entering 5min wait (Eve diagnosed but couldn't fix, Adam was SKIP'd, then back to wait). Now: timeout grants 3 consecutive Eve+Adam turn pairs (grace period). Also: APP_STARTING no longer triggers SKIP during grace period, so both agents can diagnose and write fixes before waiting resumes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>a5f444a -
fix: add smart-wait timeout to prevent infinite APP_STARTING polling
After 15 polls (~5 min) with no stage change, smart-wait exits and resumes normal agent turns so they can diagnose why Cain is stuck. Previously, APP_STARTING could block agents indefinitely (observed 34+ polls / 11+ minutes with no escape). Counter resets on any stage change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d2dcafa -
fix: clear write-dedup and knowledge cache on RUNTIME_ERROR/BUILD_ERROR
When Cain enters RUNTIME_ERROR, agents need to re-read and re-write files to fix the crash. Previously, files_written_this_cycle only cleared on successful RUNNING state, trapping agents in an infinite diagnose-verify loop where they could never apply their fix (1 success vs 9 blocks on app.py over 46 turns). Now check_health clears both write-dedup and knowledge-read caches when RUNTIME_ERROR or BUILD_ERROR is detected, unblocking the fix path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5782191 -
fix: change break→continue in action guards to preserve multi-action turns
When a single action was blocked by safety guards (rebuild cooldown, ACT-phase guard, knowledge dedup), the `break` statement terminated the entire action-parsing loop, discarding all remaining actions in the LLM's multi-action output. Changed to `continue` so blocked actions are skipped while the rest still execute. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ea70f5d -
feat: multi-action turns + sub-agent delegation + GLM-4.5
Major redesign of conversation-loop mechanism: - Model: GLM-4.7 → GLM-4.5 (user requested) - Multi-action: up to 5 actions per turn (was 1) - Sub-agent delegation: [ACTION: delegate:TASK] spawns focused sub-agents with their own LLM calls - Parallel delegation: multiple delegate tasks run concurrently via ThreadPoolExecutor - Updated system prompt teaches agents to batch reads, delegate parallel tasks, and work as project managers - Increased max_tokens to 2400 for richer multi-action responses - Turn timing adjusted to 20s for heavier turns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e91c753 -
perf: major efficiency overhaul for conversation-loop mechanism
1. Dynamic cooldown: auto-clears when build finishes instead of fixed 10min wait. Polls HF API to detect BUILDING→RUNNING/ERROR. 2. Smart wait during BUILDING: skips LLM API calls entirely when Cain is building/restarting. Polls health every 20s instead, saving API costs and avoiding wasted turns. 3. Reduced base cooldown from 600s to 360s (6 min). 4. Knowledge cache clearing: after write_file, the file is removed from the "already read" cache so agents can re-read to verify. 5. Per-cycle file write dedup: blocks writing the same Space file twice in one build cycle, preventing overwrites. 6. Cycle reset on RUNNING: write dedup set clears when Cain successfully enters RUNNING state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>869a98d -
fix: block write_file during BUILDING/APP_STARTING, fix guard bypass
- Add APP_STARTING to building-state guard (was only BUILDING/RESTARTING) - Add guards to the [CONTENT] write_file handler which previously bypassed all safety checks (building-state guard + cooldown) - Clearer error messages explaining that writes during build reset progress Without this fix, Adam & Eve could write to Space files during APP_STARTING and during BUILDING via the [CONTENT] handler, causing infinite rebuild loops. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>c7d4e65 -
fix: improve bilingual parsing to split English/Chinese by paragraph
LLM often ignores the --- separator and outputs English paragraph followed by Chinese paragraph. New fallback detects Chinese chars to find the split point, so chatlog EN/ZH toggle works correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>44f1609 -
fix: skip forced ACT transition when Cain is BUILDING/RESTARTING
Forced DIAGNOSE→ACT after 6 turns was causing agents to write files during build, resetting the build progress. Now skips forced ACT when child is in BUILDING, RESTARTING, or APP_STARTING stage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5a4dc30 -
fix: add 10-min rebuild cooldown to prevent build-reset loops
Adam & Eve kept writing Dockerfile changes every few minutes, each time resetting the build progress so Cain could never finish building. New safety layer (#2): after any write_file to Space or restart, a 10-minute cooldown blocks further Space modifications. Forces agents to wait for the build to complete before making more changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>16a30db -
fix: case-insensitive action parser — support [Action:], [操作:], [动作:]
LLM sometimes outputs mixed-case or Chinese action tags. Updated architecture diagram to reflect multilingual parser. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>10cdcf6 -
docs: sync architecture diagram with current code (glm-4.7, emoji, safety layers)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>c3aac5f -
fix: block shell expressions in set_env, show secrets in get_env
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b512df7 -
fix: expand emoji action parser to handle 🛠️ in addition to 🔧
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>20ccd66 -
feat: upgrade to GLM-4.7, add parenting goals, architecture comments, fix page width
- Switch LLM from glm-4.5-air to glm-4.7 - Add SURVIVAL + CAPABILITY growth dimensions to system prompt - Add emoji action parser fallback (🔧format) - Block restart/write during BUILDING state - Add system architecture diagram and module comments - Fix page width overflow (responsive game + chatlog layout) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8982430 -
feat: fix page width overflow + add architecture comments to conversation-loop
- Make stage-row respect viewport width (max-width: 98vw) - Game container now responsive (width: 100%, max-width: 1280px, aspect-ratio: 16/9) - Chatlog panel 300px with stretch height to match game - Add system architecture diagram and module-level comments to conversation-loop.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>a6c1202 -
fix: point Home links to new HuggingClaw-Home Space
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b8d4c73 -
docs: update README with HuggingClaw World family system, rename Office → Home
- Add HuggingClaw World section: autonomous agent family (Adam, Eve, Cain) - Document reproduction mechanism and ACTION system - Add architecture diagram for conversation-loop.py - Rename Office to Home in user-facing strings and variable names Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9ea5d13 -
fix: improve agent mechanism — error details, loop prevention, config safety
- check_health now returns actual HF runtime errorMessage - Global action history tracks all actions across turns - Smarter guidance prevents read_file loops (after 3 reads → force write) - Safety filter strips invalid OpenClaw config keys before writing - Better progression: check → read → write → verify cycle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>aaf4be2 -
fix: prevent action loops, improve diagnostic guidance
- Deduplicate actions within a turn (max 1 action per turn) - Context-aware guidance prevents repeating check_health in loops - check_health for errors now suggests specific files to read - Guidance chain: explore → read → write → verify Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>4d022f6 -
feat: give Adam & Eve full control — read/write any file, env, secrets
Complete rewrite: instead of predefined actions, Adam & Eve now have full HuggingFace API access to their child (Cain): - list_files / read_file: explore any file in Space repo or Dataset - write_file: modify any code, config, or data file - set_env / set_secret: manage environment and secrets - get_env: inspect current configuration - restart / check_health / send_bubble: operational control LLM decides when to explore, what to read, what to change. Workflow: explore → understand → improve → verify. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>f2c9f59 -
feat: make Adam & Eve true agents — they decide and act themselves
Replaced scripted phase-based actions with LLM-driven agency: - LLM outputs [ACTION: xxx] tags when it decides to act - Script parses, executes, and feeds results back to conversation - Available actions: create_child, check_child, restart_child, update_child_identity, improve_child_config - LLM gets real child status in context, acts based on actual data - Proactive guidance nudges them to act, not just discuss - Action results shared between Adam & Eve across turns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>0931506 -
fix: specify cpu-basic hardware when duplicating Space for child creation
HF API requires hardware parameter when duplicating Spaces. Also use hf_api.duplicate_space() instead of deprecated top-level function. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>be27e2d -
feat: Adam & Eve can now create and nurture children on HuggingFace
Enhanced conversation loop with real execution capabilities: - HF API integration (create Space, manage datasets, set secrets) - Phase 4 "Birth of Cain": duplicates Adam's Space as a new child - Auto-creates child dataset with initial config - Adds child to Office REMOTE_AGENTS for animation display - Nurturing cycle: health checks, auto-restart on errors - Child status injected into conversation context - Phases 5-7 repeat as ongoing parenting cycle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5c21155 -
feat: add 7-phase topic progression to Adam-Eve conversation loop
Conversation now advances through structured phases (Survival Basics, Persistent Memory, Reproduction, Resource Acquisition, Agent Alliance, Evolution, Long-term Vision) with turn-specific guidance per phase. Each phase extracts conclusions via LLM summarization before advancing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>35a128a -
fix: bypass broken A2A gateway, call Zhipu LLM directly
- A2A gateway has unfixed operator.write scope bug in current image - Conversation loop now calls Zhipu API directly (Anthropic-compatible) - Loads API key from HF dataset config automatically - Still posts bubbles and chatlog to Adam/Eve/Office Spaces Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9fc4834 -
fix: delete devices dir to force fresh auto-pair, skip error replies
- Delete ~/.openclaw/devices/ on startup to force fresh auto-pair with operator.write/read scopes (fixes A2A dispatch error) - Conversation loop now checks task state=failed and skips errors - Force rebuild (v3.9) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1e3d376 -
fix: patch paired device scopes for OpenClaw 2026.2.19+ compatibility
- Add operator.write and operator.read to paired devices on startup - Fixes 'missing scope: operator.write' A2A dispatch error - Known OpenClaw bug: auto-pair doesn't grant new scopes (issue #23006) - Force rebuild (v3.8) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d865e6e -
fix: clean up invalid auth.defaultScope from persisted config
- Remove auth.defaultScope and gateway.auth.scope on startup - These keys were synced to dataset backup and crash OpenClaw - Force rebuild (v3.7) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b17d83b