cexll
17e52d78d2
feat(codeagent-wrapper): add multi-agent support with yolo mode
...
- Add --agent parameter for agent-based backend/model resolution
- Add --prompt-file parameter for agent prompt injection
- Add opencode backend support with JSON output parsing
- Add yolo field in agent config for auto-enabling dangerous flags
- claude: --dangerously-skip-permissions
- codex: --dangerously-bypass-approvals-and-sandbox
- Add develop agent for code development tasks
- Add omo skill for multi-agent orchestration with Sisyphus coordinator
- Bump version to 5.5.0
Generated with SWE-Agent.ai
Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai >
2026-01-12 14:11:15 +08:00
makoMako
81f298c2ea
fix(parser): 修复 Gemini init 事件 session_id 未提取的问题 ( #111 )
...
Gemini CLI 的 session_id 出现在 init 事件中,但 parser 的 isGemini
判定条件只检查 role/delta/status 字段,导致 init 事件被当作
"Unknown event" 忽略,session_id 无法提取。
修复方案:在 isGemini 条件中增加对 init 事件的识别。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-authored-by: Claude <noreply@anthropic.com >
2026-01-08 14:52:58 +08:00
makoMako
40e2d00d35
修复 Windows 后端退出:taskkill 结束进程树 + turn.completed 支持 ( #108 )
...
* fix(executor): handle turn.completed and terminate process tree on Windows
* fix: 修复代码审查发现的安全和资源泄漏问题
修复内容:
1. Windows 测试 taskkill 副作用:fake process 在 Windows 上返回 Pid()==0,避免真实执行 taskkill
2. taskkill PATH 劫持风险:使用 SystemRoot 环境变量构建绝对路径
3. stdinPipe 资源泄漏:在 StdoutPipe() 和 Start() 失败路径关闭 stdinPipe
4. stderr drain 并发语义:移除 500ms 超时,确保 drain 完成后再访问共享缓冲
测试验证:
- go test ./... -race 通过
- TestRunCodexTask_ForcesStopAfterTurnCompleted 通过
- TestExecutorSignalAndTermination 通过
Generated with SWE-Agent.ai
Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai >
---------
Co-authored-by: cexll <evanxian9@gmail.com >
Co-authored-by: SWE-Agent.ai <noreply@swe-agent.ai >
2026-01-08 10:33:09 +08:00
cexll
7560ce1976
fix: 移除未知事件格式的日志噪声 ( #96 )
...
问题:
- codeagent-wrapper 在处理 Claude Code 等其他后端的事件流时
- 对无法识别的事件格式(turn.started/assistant/user)打印警告日志
- 造成输出噪声,影响用户体验
修复:
- parser.go:274 - 移除对未知事件的 warnFn 日志打印
- 改为静默 continue,直接跳过这些事件
- 添加注释说明这些事件来自其他后端,无需处理
测试:
- 新增 parser_unknown_event_test.go 回归测试
- 验证未知事件不产生 "Agent event:" 日志
- 确保 Codex/Claude/Gemini 事件解析不受影响
- 所有测试通过
Closes #96
Generated with SWE-Agent.ai
Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai >
2025-12-26 14:51:38 +08:00
ben
0f359b048f
Improve backend termination after message and extend timeout ( #86 )
...
* Improve backend termination after message and extend timeout
* fix: prevent premature backend termination and revert timeout
Critical fixes for executor.go termination logic:
1. Add onComplete callback to prevent premature termination
- Parser now distinguishes between "any message" (onMessage) and
"terminal event" (onComplete)
- Codex: triggers onComplete on thread.completed
- Claude: triggers onComplete on type:"result"
- Gemini: triggers onComplete on type:"result" + terminal status
2. Fix executor to wait for completion events
- Replace messageSeen termination trigger with completeSeen
- Only start postMessageTerminateDelay after terminal event
- Prevents killing backend before final answer in multi-message scenarios
3. Fix terminated flag synchronization
- Only set terminated=true if terminateCommandFn actually succeeds
- Prevents "marked as terminated but not actually terminated" state
4. Simplify timer cleanup logic
- Unified non-blocking drain on messageTimer.C
- Remove dependency on messageTimerCh nil state
5. Revert defaultTimeout from 24h to 2h
- 24h (86400s) → 2h (7200s) to avoid operational risks
- 12× timeout increase could cause resource exhaustion
- Users needing longer tasks can use CODEX_TIMEOUT env var
All tests pass. Resolves early termination bug from code review.
Co-authored-by: Codeagent (Codex)
Generated with SWE-Agent.ai
Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai >
---------
Co-authored-by: SWE-Agent.ai <noreply@swe-agent.ai >
2025-12-21 15:55:01 +08:00
ben
4e2df6a80e
fix: Parser重复解析优化 + 严重bug修复 + PR #86兼容性 ( #88 )
...
Merging parser optimization with critical bug fixes and PR #86 compatibility. Supersedes #84 .
2025-12-21 14:10:40 +08:00
swe-agent[bot]
6f4f4e701b
fix(parser): 修复 bufio.Scanner token too long 错误 ( #64 )
...
## 问题
- 执行 rg 等命令时,如果匹配到 minified 文件,单行输出可能超过 10MB
- 旧实现使用 bufio.Scanner,遇到超长行会报错并中止整个解析
- 导致后续的 agent_message 无法读取,任务失败
## 修复
1. **parser.go**:
- 移除 bufio.Scanner,改用 bufio.Reader + readLineWithLimit
- 超长行(>10MB)会被跳过但继续处理后续事件
- 添加 codexHeader 轻量级解析,只在 agent_message 时完整解析
2. **utils.go**:
- 修复 logWriter 内存膨胀问题
- 添加 writeLimited 方法限制缓冲区大小
3. **测试**:
- parser_token_too_long_test.go: 验证超长行处理
- log_writer_limit_test.go: 验证日志缓冲限制
## 测试结果
- ✅ TestParseJSONStream_SkipsOverlongLineAndContinues
- ✅ TestLogWriterWriteLimitsBuffer
- ✅ 完整测试套件通过
Fixes #64
Generated with swe-agent-bot
Co-Authored-By: swe-agent-bot <agent@swe-agent.ai >
2025-12-15 13:19:51 +08:00
swe-agent[bot]
c6cd20d2fd
fix(parallel): 修复并行执行启动横幅重复打印问题
...
修复 GitHub Actions 失败的测试 TestRunParallelStartupLogsPrinted。
问题根源:
- 在 main.go 中有重复的启动横幅和日志路径打印逻辑
- executeConcurrent 内部也添加了相同的打印逻辑
- 导致横幅和任务日志被打印两次
修复内容:
1. 删除 main.go 中 --parallel 处理中的重复打印代码(行 184-194)
2. 保留 executeConcurrent 中的 printTaskStart 函数,实现:
- 在任务启动时立即打印日志路径
- 使用 mutex 保护并发打印,确保横幅只打印一次
- 按实际执行顺序打印任务信息
测试结果:
- TestRunParallelStartupLogsPrinted: PASS
- TestRunNonParallelOutputsIncludeLogPathsIntegration: PASS
- TestRunStartupCleanupRemovesOrphansEndToEnd: PASS
影响范围:
- 修复了 --parallel 模式下的日志输出格式
- 不影响非并行模式的执行
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2025-12-09 17:02:59 +08:00
swe-agent[bot]
3ef288bfaa
feat: implement enterprise workflow with multi-backend support
...
## Overview
Complete implementation of enterprise-level workflow features including
multi-backend execution (Codex/Claude/Gemini), GitHub issue-to-PR automation,
hooks system, and comprehensive documentation.
## Major Changes
### 1. Multi-Backend Support (codeagent-wrapper)
- Renamed codex-wrapper → codeagent-wrapper
- Backend interface with Codex/Claude/Gemini implementations
- Multi-format JSON stream parser (auto-detects backend)
- CLI flag: --backend codex|claude|gemini (default: codex)
- Test coverage: 89.2%
**Files:**
- codeagent-wrapper/backend.go - Backend interface
- codeagent-wrapper/parser.go - Multi-format parser
- codeagent-wrapper/config.go - CLI parsing with backend selection
- codeagent-wrapper/executor.go - Process execution
- codeagent-wrapper/logger.go - Async logging
- codeagent-wrapper/utils.go - Utilities
### 2. GitHub Workflow Commands
- /gh-create-issue - Create structured issues via guided dialogue
- /gh-implement - Issue-to-PR automation with full dev lifecycle
**Files:**
- github-workflow/commands/gh-create-issue.md
- github-workflow/commands/gh-implement.md
- skills/codeagent/SKILL.md
### 3. Hooks System
- UserPromptSubmit hook for skill activation
- Pre-commit example with code quality checks
- merge_json operation in install.py for settings.json merging
**Files:**
- hooks/skill-activation-prompt.sh|.js
- hooks/pre-commit.sh
- hooks/hooks-config.json
- hooks/test-skill-activation.sh
### 4. Skills System
- skill-rules.json for auto-activation
- codeagent skill for multi-backend wrapper
**Files:**
- skills/skill-rules.json
- skills/codeagent/SKILL.md
- skills/codex/SKILL.md (updated)
### 5. Installation System
- install.py: Added merge_json operation
- config.json: Added "gh" module
- config.schema.json: Added op_merge_json schema
### 6. CI/CD
- GitHub Actions workflow for testing and building
**Files:**
- .github/workflows/ci.yml
### 7. Comprehensive Documentation
- Architecture overview with ASCII diagrams
- Codeagent-wrapper complete usage guide
- GitHub workflow detailed examples
- Hooks customization guide
**Files:**
- docs/architecture.md (21KB)
- docs/CODEAGENT-WRAPPER.md (9KB)
- docs/GITHUB-WORKFLOW.md (9KB)
- docs/HOOKS.md (4KB)
- docs/enterprise-workflow-ideas.md
- README.md (updated with doc links)
## Test Results
- All tests passing ✅
- Coverage: 89.2%
- Security scan: 0 issues (gosec)
## Breaking Changes
- codex-wrapper renamed to codeagent-wrapper
- Default backend: codex (documented in README)
## Migration Guide
Users with codex-wrapper installed should:
1. Run: python3 install.py --module dev --force
2. Update shell aliases if any
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2025-12-09 15:53:31 +08:00