Fix/inbox send stdin content#9
Open
Fiooodooor wants to merge 2 commits into
Open
Conversation
added 2 commits
March 20, 2026 00:27
… IPC - Add strict whitelist protection mode for workspace pruning - Implement symlink-based dependency sharing (node_modules, .venv) - Add headless worker wrapper script for non-interactive execution - Fix environment variable inheritance bug - 98.8% workspace size reduction for multi-agent teams Tested with: - Tavily search API (real-time data, no cache) - Swarm inbox IPC communication - Multi-agent team deployments
When clawteam inbox send is called from a subprocess or shell script (e.g., via runtime watch --exec), the content argument can be lost. This fix makes content an optional argument that falls back to reading from stdin, enabling reliable script integration. Fixes HKUDS#130
There was a problem hiding this comment.
Pull request overview
This PR aims to improve message delivery to the team inbox (notably by allowing clawteam inbox send to take message content from stdin when the positional CONTENT argument is omitted). It also introduces a new OpenClaw worker wrapper script and makes substantial workspace/prompt behavior changes.
Changes:
- Make
clawteam inbox sendaccept message content fromstdinwhenCONTENTis not provided. - Add
scripts/openclaw_worker.shto run an OpenClaw worker and forward results to a team inbox. - Modify workspace creation to aggressively delete non-whitelisted files and symlink dependency directories; adjust agent prompt examples to send to a hardcoded
"leader"inbox.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
scripts/openclaw_worker.sh |
Adds a worker wrapper script that runs openclaw agent and forwards output to clawteam inbox send. |
clawteam/workspace/manager.py |
Adds post-worktree “whitelist delete” cleanup, symlink-based dependency sharing, and required-file self-checks. |
clawteam/spawn/prompt.py |
Changes prompt examples to send messages to a constant "leader" recipient instead of the configured leader name. |
clawteam/cli/commands.py |
Makes inbox CONTENT optional and reads message content from stdin when omitted. |
Comment on lines
+85
to
+145
| # 🚀 绝对白名单保护模式 v3.0 | ||
| # -------------------------- | ||
| # 【绝对不能删的白名单】 | ||
| KEEP_ALWAYS = [ | ||
| # 核心命脉 | ||
| "openclaw.json", | ||
| ".env", | ||
| ".env.local", | ||
|
|
||
| # 认知系统 | ||
| "SOUL.md", | ||
| "AGENTS.md", | ||
| "TOOLS.md", | ||
| "MEMORY.md", | ||
| "HEARTBEAT.md", | ||
| "IDENTITY.md", | ||
| "USER.md", | ||
|
|
||
| # 技能和工具 | ||
| "skills/", | ||
| "scripts/", | ||
| ".openclaw/", | ||
| ".clawhub/", | ||
|
|
||
| # 环境配置 | ||
| "node_modules/", | ||
| "venv/", | ||
| ".venv/", | ||
| "poetry.lock", | ||
| "pyproject.toml", | ||
| "requirements.txt", | ||
|
|
||
| # git工作树必须保留 | ||
| ".git", | ||
| ] | ||
|
|
||
| # 遍历目录删除 | ||
| for item in wt_path.iterdir(): | ||
| # 检查是否在白名单 | ||
| keep = False | ||
| for pattern in KEEP_ALWAYS: | ||
| if pattern.endswith("/"): | ||
| # 目录匹配 | ||
| if item.is_dir() and item.name == pattern.rstrip("/"): | ||
| keep = True | ||
| break | ||
| else: | ||
| # 文件匹配 | ||
| if item.is_file() and item.name == pattern: | ||
| keep = True | ||
| break | ||
|
|
||
| # 不在白名单就删除 | ||
| if not keep: | ||
| try: | ||
| if item.is_file() or item.is_symlink(): | ||
| item.unlink() | ||
| elif item.is_dir(): | ||
| shutil.rmtree(item) | ||
| except Exception as e: | ||
| logger.warning(f"删除文件失败 {item}: {e}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Change Type
Scope
NIC Porting Context (if applicable)
Gate Checklist (NIC porting PRs)
Linked Issue/PR
Root Cause / Regression History (if applicable)
Risk Register Impact
Regression Test Plan
For bug fixes, name the test(s) that would have caught this. For porting slices,
list the TDD tests that validate the change. Otherwise write
N/A.User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.