test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
|
|
|
|
|
package agentic
|
|
|
|
|
|
|
|
|
|
import (
|
2026-03-31 06:44:56 +00:00
|
|
|
"context"
|
|
|
|
|
"sync"
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
"testing"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"dappco.re/go/agent/pkg/messages"
|
|
|
|
|
core "dappco.re/go/core"
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2026-03-31 06:44:56 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
)
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
// newCoreForHandlerTests creates a Core with PrepSubsystem registered via
|
|
|
|
|
// RegisterService — HandleIPCEvents is auto-discovered.
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
func newCoreForHandlerTests(t *testing.T) (*core.Core, *PrepSubsystem) {
|
|
|
|
|
t.Helper()
|
|
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
|
|
|
|
s := &PrepSubsystem{
|
2026-03-26 06:38:02 +00:00
|
|
|
codePath: t.TempDir(),
|
|
|
|
|
pokeCh: make(chan struct{}, 1),
|
|
|
|
|
backoff: make(map[string]time.Time),
|
|
|
|
|
failCount: make(map[string]int),
|
|
|
|
|
workspaces: core.NewRegistry[*WorkspaceStatus](),
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
c := core.New()
|
2026-03-26 06:38:02 +00:00
|
|
|
c.Config().Enable("auto-ingest")
|
feat(v0.8.0): full AX migration — ServiceRuntime, Actions, quality gates, transport
go-process:
- Register factory, Result lifecycle, 5 named Action handlers
- Start/Run/StartWithOptions/RunWithOptions all return core.Result
- core.ID() replaces fmt.Sprintf, core.As replaces errors.As
core/agent:
- PrepSubsystem + monitor.Subsystem + setup.Service embed ServiceRuntime[T]
- 22 named Actions + agent.completion Task pipeline in OnStartup
- ChannelNotifier removed — all IPC via c.ACTION(messages.X{})
- proc.go: all methods via s.Core().Process(), returns core.Result
- status.go: WriteAtomic + JSONMarshalString
- paths.go: Fs.NewUnrestricted() replaces unsafe.Pointer
- transport.go: ONE net/http file — HTTPGet/HTTPPost/HTTPDo/MCP transport
- All disallowed imports eliminated from source files (13 quality gates)
- String concat eliminated — core.Concat() throughout
- 1:1 _test.go + _example_test.go for every source file
- Reference docs synced from core/go v0.8.0
- RFC-025 updated with net/http, net/url, io/fs quality gates
- lib.go: io/fs eliminated via Data.ListNames, Array[T].Deduplicate
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 01:27:46 +00:00
|
|
|
s.ServiceRuntime = core.NewServiceRuntime(c, AgentOptions{})
|
2026-03-26 06:38:02 +00:00
|
|
|
// RegisterService auto-discovers HandleIPCEvents on PrepSubsystem
|
|
|
|
|
c.RegisterService("agentic", s)
|
2026-03-31 06:44:56 +00:00
|
|
|
RegisterHandlers(c, s)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
|
|
|
|
return c, s
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
// --- HandleIPCEvents ---
|
|
|
|
|
|
|
|
|
|
func TestHandlers_HandleIPCEvents_Good(t *testing.T) {
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
c, _ := newCoreForHandlerTests(t)
|
2026-03-26 06:38:02 +00:00
|
|
|
// HandleIPCEvents was auto-registered — Core should not panic on ACTION
|
|
|
|
|
assert.NotPanics(t, func() {
|
|
|
|
|
c.ACTION(messages.AgentCompleted{Workspace: "nonexistent", Repo: "test", Status: "completed"})
|
|
|
|
|
})
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_PokeOnCompletion_Good(t *testing.T) {
|
2026-03-31 06:44:56 +00:00
|
|
|
c, _ := newCoreForHandlerTests(t)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
2026-03-31 06:44:56 +00:00
|
|
|
poked := make(chan struct{}, 1)
|
2026-04-02 03:21:44 +00:00
|
|
|
c.RegisterAction(func(_ *core.Core, msg core.Message) core.Result {
|
|
|
|
|
if _, ok := msg.(messages.PokeQueue); ok {
|
|
|
|
|
select {
|
|
|
|
|
case poked <- struct{}{}:
|
|
|
|
|
default:
|
|
|
|
|
}
|
2026-03-31 06:44:56 +00:00
|
|
|
}
|
|
|
|
|
return core.Result{OK: true}
|
|
|
|
|
})
|
2026-04-02 03:21:44 +00:00
|
|
|
c.Action("runner.poke", func(_ context.Context, _ core.Options) core.Result { return core.Result{OK: true} })
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
2026-03-31 06:44:56 +00:00
|
|
|
c.ACTION(messages.AgentCompleted{
|
2026-03-26 06:38:02 +00:00
|
|
|
Workspace: "ws-test", Repo: "go-io", Status: "completed",
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
})
|
|
|
|
|
|
2026-03-31 06:44:56 +00:00
|
|
|
require.Eventually(t, func() bool { return len(poked) == 1 }, time.Second, 10*time.Millisecond)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_IngestOnCompletion_Good(t *testing.T) {
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
c, _ := newCoreForHandlerTests(t)
|
|
|
|
|
|
|
|
|
|
root := WorkspaceRoot()
|
2026-03-30 21:30:49 +00:00
|
|
|
workspaceName := "core/test/task-2"
|
|
|
|
|
workspaceDir := core.JoinPath(root, workspaceName)
|
|
|
|
|
repoDir := core.JoinPath(workspaceDir, "repo")
|
2026-03-26 01:55:57 +00:00
|
|
|
fs.EnsureDir(repoDir)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
|
|
|
|
st := &WorkspaceStatus{
|
|
|
|
|
Status: "completed",
|
|
|
|
|
Repo: "test",
|
|
|
|
|
Agent: "codex",
|
|
|
|
|
Task: "Review code",
|
|
|
|
|
}
|
2026-03-30 21:30:49 +00:00
|
|
|
writeStatus(workspaceDir, st)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
|
|
|
|
// Should not panic — ingest handler runs but no findings file
|
|
|
|
|
c.ACTION(messages.AgentCompleted{
|
2026-03-30 21:30:49 +00:00
|
|
|
Workspace: workspaceName,
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
Repo: "test",
|
|
|
|
|
Status: "completed",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_IgnoresNonCompleted_Good(t *testing.T) {
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
c, _ := newCoreForHandlerTests(t)
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
// Non-completed status — ingest still runs (it handles all completions)
|
|
|
|
|
assert.NotPanics(t, func() {
|
|
|
|
|
c.ACTION(messages.AgentCompleted{
|
|
|
|
|
Workspace: "nonexistent",
|
|
|
|
|
Repo: "test",
|
|
|
|
|
Status: "failed",
|
|
|
|
|
})
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_PokeQueue_Good(t *testing.T) {
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
c, s := newCoreForHandlerTests(t)
|
|
|
|
|
s.frozen = true // frozen so drainQueue is a no-op
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
// PokeQueue message → drainQueue called
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
c.ACTION(messages.PokeQueue{})
|
|
|
|
|
// Should call drainQueue without panic
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-31 06:44:56 +00:00
|
|
|
func TestHandlers_RegisterHandlers_Good_CompletionPipeline(t *testing.T) {
|
|
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
2026-03-31 06:44:56 +00:00
|
|
|
|
|
|
|
|
workspaceName := "core/go-io/task-5"
|
|
|
|
|
workspaceDir := core.JoinPath(root, "workspace", "core", "go-io", "task-5")
|
|
|
|
|
require.True(t, fs.EnsureDir(core.JoinPath(workspaceDir, "repo")).OK)
|
|
|
|
|
require.NoError(t, writeStatus(workspaceDir, &WorkspaceStatus{
|
|
|
|
|
Status: "completed",
|
|
|
|
|
Repo: "go-io",
|
|
|
|
|
Branch: "agent/fix-tests",
|
|
|
|
|
Agent: "codex",
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
var mu sync.Mutex
|
|
|
|
|
called := make(map[string]bool)
|
|
|
|
|
mark := func(name string) {
|
|
|
|
|
mu.Lock()
|
|
|
|
|
called[name] = true
|
|
|
|
|
mu.Unlock()
|
|
|
|
|
}
|
|
|
|
|
seen := func(name string) bool {
|
|
|
|
|
mu.Lock()
|
|
|
|
|
defer mu.Unlock()
|
|
|
|
|
return called[name]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
c := core.New()
|
|
|
|
|
c.Config().Enable("auto-ingest")
|
|
|
|
|
RegisterHandlers(c, &PrepSubsystem{})
|
|
|
|
|
|
|
|
|
|
c.Action("agentic.qa", func(_ context.Context, options core.Options) core.Result {
|
|
|
|
|
if options.String("workspace") == workspaceDir {
|
|
|
|
|
mark("qa")
|
|
|
|
|
}
|
|
|
|
|
c.ACTION(messages.QAResult{Workspace: workspaceName, Repo: "go-io", Passed: true})
|
|
|
|
|
return core.Result{OK: true}
|
|
|
|
|
})
|
|
|
|
|
c.Action("agentic.auto-pr", func(_ context.Context, options core.Options) core.Result {
|
|
|
|
|
if options.String("workspace") == workspaceDir {
|
|
|
|
|
mark("auto-pr")
|
|
|
|
|
}
|
|
|
|
|
c.ACTION(messages.PRCreated{
|
|
|
|
|
Repo: "go-io",
|
|
|
|
|
Branch: "agent/fix-tests",
|
|
|
|
|
PRURL: "https://forge.lthn.ai/core/go-io/pulls/12",
|
|
|
|
|
PRNum: 12,
|
|
|
|
|
})
|
|
|
|
|
return core.Result{OK: true}
|
|
|
|
|
})
|
|
|
|
|
c.Action("agentic.verify", func(_ context.Context, options core.Options) core.Result {
|
|
|
|
|
if options.String("workspace") == workspaceDir {
|
|
|
|
|
mark("verify")
|
|
|
|
|
}
|
|
|
|
|
return core.Result{OK: true}
|
|
|
|
|
})
|
|
|
|
|
c.Action("agentic.ingest", func(_ context.Context, options core.Options) core.Result {
|
|
|
|
|
if options.String("workspace") == workspaceDir {
|
|
|
|
|
mark("ingest")
|
|
|
|
|
}
|
|
|
|
|
return core.Result{OK: true}
|
|
|
|
|
})
|
2026-04-02 03:21:44 +00:00
|
|
|
c.RegisterAction(func(_ *core.Core, msg core.Message) core.Result {
|
|
|
|
|
if _, ok := msg.(messages.PokeQueue); ok {
|
|
|
|
|
mark("poke")
|
|
|
|
|
}
|
2026-03-31 06:44:56 +00:00
|
|
|
return core.Result{OK: true}
|
|
|
|
|
})
|
2026-04-02 03:21:44 +00:00
|
|
|
c.Action("runner.poke", func(_ context.Context, _ core.Options) core.Result { return core.Result{OK: true} })
|
2026-03-31 06:44:56 +00:00
|
|
|
|
|
|
|
|
c.ACTION(messages.AgentCompleted{
|
|
|
|
|
Workspace: workspaceName,
|
|
|
|
|
Repo: "go-io",
|
|
|
|
|
Status: "completed",
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
require.Eventually(t, func() bool {
|
|
|
|
|
return seen("qa") && seen("auto-pr") && seen("verify") && seen("ingest") && seen("poke")
|
|
|
|
|
}, time.Second, 10*time.Millisecond)
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-02 01:33:52 +00:00
|
|
|
func TestHandlers_FindWorkspaceByPR_Good_MatchesPRNumber(t *testing.T) {
|
|
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
2026-04-02 01:33:52 +00:00
|
|
|
|
|
|
|
|
firstWorkspace := core.JoinPath(WorkspaceRoot(), "core", "go-io", "task-1")
|
|
|
|
|
secondWorkspace := core.JoinPath(WorkspaceRoot(), "core", "go-io", "task-2")
|
|
|
|
|
require.True(t, fs.EnsureDir(firstWorkspace).OK)
|
|
|
|
|
require.True(t, fs.EnsureDir(secondWorkspace).OK)
|
|
|
|
|
|
|
|
|
|
require.NoError(t, writeStatus(firstWorkspace, &WorkspaceStatus{
|
|
|
|
|
Status: "completed",
|
|
|
|
|
Repo: "go-io",
|
|
|
|
|
Branch: "agent/first",
|
|
|
|
|
PRURL: "https://forge.lthn.ai/core/go-io/pulls/12",
|
|
|
|
|
}))
|
|
|
|
|
require.NoError(t, writeStatus(secondWorkspace, &WorkspaceStatus{
|
|
|
|
|
Status: "completed",
|
|
|
|
|
Repo: "go-io",
|
|
|
|
|
Branch: "agent/second",
|
|
|
|
|
PRURL: "https://forge.lthn.ai/core/go-io/pulls/13",
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
result := findWorkspaceByPRWithInfo("go-io", "", 13, "https://forge.lthn.ai/core/go-io/pulls/13")
|
|
|
|
|
assert.Equal(t, secondWorkspace, result)
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_IngestDisabled_Bad(t *testing.T) {
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
|
|
|
|
s := &PrepSubsystem{
|
2026-03-26 06:38:02 +00:00
|
|
|
pokeCh: make(chan struct{}, 1),
|
|
|
|
|
backoff: make(map[string]time.Time),
|
|
|
|
|
failCount: make(map[string]int),
|
|
|
|
|
workspaces: core.NewRegistry[*WorkspaceStatus](),
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
c := core.New()
|
|
|
|
|
c.Config().Disable("auto-ingest") // disabled
|
|
|
|
|
s.ServiceRuntime = core.NewServiceRuntime(c, AgentOptions{})
|
|
|
|
|
c.RegisterService("agentic", s)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
wsDir := core.JoinPath(WorkspaceRoot(), "ws-test")
|
|
|
|
|
fs.EnsureDir(core.JoinPath(wsDir, "repo"))
|
|
|
|
|
writeStatus(wsDir, &WorkspaceStatus{Status: "completed", Repo: "test", Agent: "codex"})
|
|
|
|
|
|
|
|
|
|
// With auto-ingest disabled, should still not panic
|
|
|
|
|
c.ACTION(messages.AgentCompleted{Workspace: "ws-test", Repo: "test", Status: "completed"})
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_ResolveWorkspace_Good(t *testing.T) {
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
2026-03-26 06:38:02 +00:00
|
|
|
wsRoot := core.JoinPath(root, "workspace")
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
ws := core.JoinPath(wsRoot, "core", "go-io", "task-15")
|
|
|
|
|
fs.EnsureDir(ws)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
result := resolveWorkspace("core/go-io/task-15")
|
|
|
|
|
assert.Equal(t, ws, result)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_ResolveWorkspace_Bad(t *testing.T) {
|
|
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
result := resolveWorkspace("nonexistent")
|
|
|
|
|
assert.Empty(t, result)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_FindWorkspaceByPR_Good(t *testing.T) {
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
2026-03-26 06:38:02 +00:00
|
|
|
wsRoot := core.JoinPath(root, "workspace")
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
ws := core.JoinPath(wsRoot, "ws-test")
|
|
|
|
|
fs.EnsureDir(ws)
|
|
|
|
|
st := &WorkspaceStatus{Repo: "go-io", Branch: "agent/fix", Status: "completed"}
|
|
|
|
|
fs.Write(core.JoinPath(ws, "status.json"), core.JSONMarshalString(st))
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
result := findWorkspaceByPR("go-io", "agent/fix")
|
|
|
|
|
assert.Equal(t, ws, result)
|
test: 413 new tests — agentic 54.3%, setup 75.8%, all packages passing
Coverage: agentic 40.1% → 54.3%, setup 71.5% → 75.8%
Total: 695 passing tests across all packages (was ~357)
New test files (15):
- commands_forge_test.go — parseForgeArgs, fmtIndex
- commands_workspace_test.go — extractField (9 cases)
- commands_test.go — command registration + Core integration
- handlers_test.go — RegisterHandlers, IPC pipeline, lifecycle
- plan_crud_test.go — full CRUD via MCP handlers (23 tests)
- prep_extra_test.go — buildPrompt, findConsumersList, pullWikiContent, getIssueBody
- queue_extra_test.go — ConcurrencyLimit YAML, delayForAgent, drainOne
- remote_client_test.go — mcpInitialize, mcpCall, readSSEData, setHeaders
- remote_test.go — resolveHost, remoteToken
- resume_test.go — resume dry run, agent override, validation
- review_queue_test.go — countFindings, parseRetryAfter, buildAutoPRBody
- review_queue_extra_test.go — buildReviewCommand, rateLimitState, reviewQueue
- verify_extra_test.go — attemptVerifyAndMerge, autoVerifyAndMerge pipeline
- watch_test.go — findActiveWorkspaces, resolveWorkspaceDir
- setup/setup_extra_test.go — defaultBuildCommand, defaultTestCommand all branches
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 00:44:17 +00:00
|
|
|
}
|
2026-03-25 10:28:30 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_FindWorkspaceByPR_Ugly(t *testing.T) {
|
2026-03-25 10:28:30 +00:00
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
2026-03-26 06:38:02 +00:00
|
|
|
wsRoot := core.JoinPath(root, "workspace")
|
2026-03-25 10:28:30 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
// Deep layout: org/repo/task
|
|
|
|
|
ws := core.JoinPath(wsRoot, "core", "agent", "task-5")
|
|
|
|
|
fs.EnsureDir(ws)
|
|
|
|
|
st := &WorkspaceStatus{Repo: "agent", Branch: "agent/tests", Status: "completed"}
|
|
|
|
|
fs.Write(core.JoinPath(ws, "status.json"), core.JSONMarshalString(st))
|
2026-03-25 10:28:30 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
result := findWorkspaceByPR("agent", "agent/tests")
|
|
|
|
|
assert.Equal(t, ws, result)
|
2026-03-25 10:28:30 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
// --- command registration ---
|
|
|
|
|
|
|
|
|
|
func TestHandlers_Commandsforge_Good(t *testing.T) {
|
|
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
2026-03-26 06:38:02 +00:00
|
|
|
|
2026-03-25 10:28:30 +00:00
|
|
|
s := &PrepSubsystem{
|
2026-03-26 06:38:02 +00:00
|
|
|
ServiceRuntime: core.NewServiceRuntime(core.New(), AgentOptions{}),
|
|
|
|
|
backoff: make(map[string]time.Time),
|
|
|
|
|
failCount: make(map[string]int),
|
2026-03-25 10:28:30 +00:00
|
|
|
}
|
2026-03-26 06:38:02 +00:00
|
|
|
assert.NotPanics(t, func() { s.registerForgeCommands() })
|
2026-03-25 10:28:30 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
func TestHandlers_Commandsworkspace_Good(t *testing.T) {
|
2026-03-25 10:28:30 +00:00
|
|
|
root := t.TempDir()
|
2026-04-08 16:15:14 +01:00
|
|
|
setTestWorkspace(t, root)
|
2026-03-25 10:28:30 +00:00
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
s := &PrepSubsystem{
|
|
|
|
|
ServiceRuntime: core.NewServiceRuntime(core.New(), AgentOptions{}),
|
|
|
|
|
backoff: make(map[string]time.Time),
|
|
|
|
|
failCount: make(map[string]int),
|
|
|
|
|
}
|
|
|
|
|
assert.NotPanics(t, func() { s.registerWorkspaceCommands() })
|
2026-03-25 10:28:30 +00:00
|
|
|
}
|