Add a new integration test suite that verifies real agent (Claude Code, Codex,
Cursor, Gemini, OpenCode) interactions with a mock platform. Tests are gated
by //go:build integration tag so they're excluded from normal CI.
core/engine.go:
- Add public ReceiveMessage(p, msg) method to allow test callers to
inject messages into the engine
tests/integration/agent_integration_test.go:
- mockPlatform implementing core.Platform interface for test verification
- agentPool for reusing agent instances across tests
- Session tests: new session, /list, /switch, /stop, /new context clear, /history
- Agent tests: claude code, codex, cursor, gemini (skip if quota), opencode (skip if no gitlab auth)
- Command tests: /shell (skip if admin_from not set), /provider list
- i18n: /lang zh language switch
- Concurrency: session isolation, long text chunking, empty message handling
docs/plans/2026-03-24-integration-tests.md:
- Test plan listing all implemented and planned integration test cases
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The changes add error handling for previously ignored operations and introduce logging for critical errors and warnings. This includes:
- Adding error checks for file operations, JSON unmarshaling, system calls
- Logging warnings/errors for failed operations using slog
- Properly handling return values from functions that were previously ignored
- Adding context to error messages for better debugging
- Cleaning up unused code and variables
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Updated the GitHub CI workflow to use the correct golangci-lint installation path. Enhanced test mocks with proper mutex protection in TestMessageHandler and cleaned up FakeAgentSession implementation for better thread safety and performance.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
- session.go: Events() now correctly checks if last event
already has Done=true before appending an extra Done event
- message.go: TestLongMessage now uses strings.Repeat instead
of null bytes
- message.go: BatchTestMessages now uses fmt.Sprintf
instead of rune overflow-prone string concatenation
- response.go: TestAgentSessionInfoList now uses fmt.Sprintf
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add:
- T-241: Discord embed format regression test
- T-242: Telegram command parsing regression test
- T-243: DingTalk crypto/regression test
- T-252: Cron job cancellation regression test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add testify and httpmock dependencies for testing
- Create tests/ directory structure with mocks and fakes
- Add mock_platform.go: mock for core.Platform interface
- Add mock_agent.go: mock for core.Agent/AgentSession interfaces
- Add fake/message.go: test message and event fixtures
- Add fake/session.go: fake agent session implementation
- Add fake/response.go: test helpers and fixtures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>