cexll
0c680bd374
fix: code review fixes for PR #94 - all critical and major issues resolved
...
This commit addresses all Critical and Major issues identified in the code review:
Critical Issues Fixed:
- #1 : Test statistics data loss (utils.go:480) - Changed exit condition from || to &&
- #2 : Below-target header showing "below 0%" - Added defaultCoverageTarget constant
Major Issues Fixed:
- #3 : Coverage extraction not robust - Relaxed trigger conditions for various formats
- #4 : 0% coverage ignored - Changed from CoverageNum>0 to Coverage!="" check
- #5 : File change extraction incomplete - Support root files and @ prefix
- #6 : String truncation panic risk - Added safeTruncate() with rune-based truncation
- #7 : Breaking change documentation missing - Updated help text and docs
- #8 : .DS_Store garbage files - Removed files and updated .gitignore
- #9 : Test coverage insufficient - Added 29+ test cases in utils_test.go
- #10 : Terminal escape injection risk - Added sanitizeOutput() for ANSI cleaning
- #11 : Redundant code - Removed unused patterns variable
Test Results:
- All tests pass: go test ./... (34.283s)
- Test coverage: 88.4% (up from ~85%)
- New test file: codeagent-wrapper/utils_test.go
- No breaking changes to existing functionality
Files Modified:
- codeagent-wrapper/utils.go (+166 lines) - Core fixes and new functions
- codeagent-wrapper/executor.go (+111 lines) - Output format fixes
- codeagent-wrapper/main.go (+45 lines) - Configuration updates
- codeagent-wrapper/main_test.go (+40 lines) - New integration tests
- codeagent-wrapper/utils_test.go (new file) - Complete extractor tests
- docs/CODEAGENT-WRAPPER.md (+38 lines) - Documentation updates
- .gitignore (+2 lines) - Added .DS_Store patterns
- Deleted 5 .DS_Store files
Verification:
- Binary compiles successfully (v5.4.0)
- All extractors validated with real-world test cases
- Security vulnerabilities patched
- Performance maintained (90% token reduction preserved)
Related: #94
Generated with SWE-Agent.ai
Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai >
2025-12-24 09:51:39 +08:00
jiesen
dfb0fc787e
feat(codeagent-wrapper): v5.4.0 structured execution report
...
- Add structured report output format for parallel execution
- Extract coverage, files changed, test results from task output
- Show Did/Files/Tests for passed tasks, Error/Detail for failed
- Reduce token consumption from ~15k to ~1.5k for 30 tasks
- Add extractCoverage, extractErrorDetail, extractKeyOutput utils
- Extend TaskResult with Coverage, FilesChanged, KeyOutput fields
- Update tests and documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2025-12-22 13:06:28 +07: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]
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