← 返回
未分类 Key

Codex via tmux (WSL2 / Custom Proxy)

Launch long-running Codex (or Claude Code) coding tasks via tmux on WSL2/Linux, bypassing SIGTERM timeouts. Use this skill INSTEAD OF coding-agent whenever:...
通过 tmux 在 WSL2/Linux 上启动长时间运行的 Codex(或 Claude Code)任务,绕过 SIGTERM 超时。此技能适用于:
inuyashayang
未分类 clawhub v1.0.0 1 版本 99428.6 Key: 需要
★ 0
Stars
📥 174
下载
💾 0
安装
1
版本
#latest

概述

Codex via tmux (WSL2 / Custom Proxy)

Preferred pattern for all Codex full-auto tasks on this machine. Avoids SIGTERM, supports mid-run steering.

Environment (this machine)

OPENAI_API_KEY="sk-5Ds6eFbTEE1zu5fQ14F4FfB5892b419dB1BfC7292147B9Ef"
OPENAI_BASE_URL="http://152.53.52.170:3003/v1"

Always pass both vars. Do NOT rely on shell inheritance — OpenClaw subprocesses don't source .bashrc.

Standard Launch Pattern

SESSION="codex-<feature>"   # e.g. codex-auth, codex-tools
WORKDIR=~/MyClaw            # or target repo

tmux new-session -d -s "$SESSION" -c "$WORKDIR" \
  "OPENAI_API_KEY='sk-5Ds6e...' OPENAI_BASE_URL='http://152.53.52.170:3003/v1' \
   codex --model gpt-5.3-codex --full-auto '$(cat /tmp/task.txt)'"

Write long prompts to /tmp/task.txt first, then reference via $(cat /tmp/task.txt).

Monitoring

# Check if alive
tmux has-session -t "$SESSION" 2>/dev/null && echo running || echo done

# Tail output (last 50 lines)
tmux capture-pane -t "$SESSION" -p | tail -50

# Or via OpenClaw exec:
exec("tmux capture-pane -t codex-auth -p | tail -30")

Mid-run Steering

tmux send-keys -t "$SESSION" "停一下。先做 API 层,不要改 UI。" Enter
tmux send-keys -t "$SESSION" "类型定义在 src/types.ts,用那个。" Enter

Task JSON Tracking

Write to /tmp/codex-tasks.json to track parallel jobs:

{
  "id": "feat-tools",
  "session": "codex-tools",
  "model": "gpt-5.3-codex",
  "desc": "实现工具系统 exec/read/write/web_fetch",
  "repo": "MyClaw",
  "startedAt": 1772433000000,
  "status": "running"
}

Completion Check

Poll every 2–3 min via:

tmux has-session -t "$SESSION" 2>/dev/null || echo "DONE"
git -C "$WORKDIR" log --oneline -3

Codex "完成" = tmux session 自动退出 + git commit 存在。

Cleanup

tmux kill-session -t "$SESSION" 2>/dev/null
git worktree prune

MyClaw-Specific Notes

  • Repo: ~/MyClaw, GitHub: https://github.com/InuyashaYang/MyClaw
  • 模型首选 gpt-5.3-codex,轻量测试用 gpt-4.1-mini
  • 详细已知坑见 → references/lessons.md

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-20 06:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

知乎发帖 (Zhihu Post via Browser Relay)

inuyashayang
在知乎发布内容(专栏文章、想法/动态)。使用 Chrome Browser Relay 控制用户的 Chrome 浏览器完成发布。触发词:知乎发帖、发知乎、知乎文章、知乎想法、zhihu post、发布到知乎、帮我发知乎。
★ 1 📥 1,270
content-creation

Feishu Image Sender 飞书发图指南

inuyashayang
Feishu IM messaging operations: send messages, images, files to users and groups via Bot API. Activate when user mention
★ 1 📥 929

Worktree Agents

inuyashayang
使用 git worktree 隔离多个 Claude Code 实例,由 OpenClaw 主控器并行调度完成同一项目的不同模块。 适用场景:将一个编码项目拆分为独立子任务,让多个 Claude Code 实例并行实现,最后合并 PR。
★ 0 📥 189