2026-03-24 14:24:46 +00:00
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
|
2026-03-31 06:20:14 +00:00
|
|
|
// c.ACTION(messages.AgentCompleted{Agent: "codex", Repo: "go-io", Workspace: "core/go-io/task-5", Status: "completed"})
|
2026-03-24 14:24:46 +00:00
|
|
|
package messages
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.AgentStarted{Agent: "codex", Repo: "go-io", Workspace: "core/go-io/task-5"})
|
2026-03-24 14:24:46 +00:00
|
|
|
type AgentStarted struct {
|
|
|
|
|
Agent string
|
|
|
|
|
Repo string
|
|
|
|
|
Workspace string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.AgentCompleted{Agent: "codex", Repo: "go-io", Workspace: "core/go-io/task-5", Status: "completed"})
|
2026-03-24 14:24:46 +00:00
|
|
|
type AgentCompleted struct {
|
|
|
|
|
Agent string
|
|
|
|
|
Repo string
|
|
|
|
|
Workspace string
|
2026-03-31 06:03:37 +00:00
|
|
|
Status string
|
2026-03-24 14:24:46 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.QAResult{Workspace: "core/go-io/task-5", Repo: "go-io", Passed: true})
|
2026-03-24 14:24:46 +00:00
|
|
|
type QAResult struct {
|
|
|
|
|
Workspace string
|
|
|
|
|
Repo string
|
|
|
|
|
Passed bool
|
|
|
|
|
Output string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-31 06:20:14 +00:00
|
|
|
// c.ACTION(messages.PRCreated{Repo: "go-io", Branch: "agent/fix-tests", PRURL: "https://forge.lthn.ai/core/go-io/pulls/12", PRNum: 12})
|
2026-03-24 14:24:46 +00:00
|
|
|
type PRCreated struct {
|
|
|
|
|
Repo string
|
|
|
|
|
Branch string
|
|
|
|
|
PRURL string
|
|
|
|
|
PRNum int
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-31 06:20:14 +00:00
|
|
|
// c.ACTION(messages.PRMerged{Repo: "go-io", PRURL: "https://forge.lthn.ai/core/go-io/pulls/12", PRNum: 12})
|
2026-03-24 14:24:46 +00:00
|
|
|
type PRMerged struct {
|
|
|
|
|
Repo string
|
|
|
|
|
PRURL string
|
|
|
|
|
PRNum int
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-31 07:27:15 +00:00
|
|
|
// c.ACTION(messages.WorkspacePushed{Repo: "go-io", Branch: "agent/fix-tests", Org: "core"})
|
|
|
|
|
type WorkspacePushed struct {
|
|
|
|
|
Repo string
|
|
|
|
|
Branch string
|
|
|
|
|
Org string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.PRNeedsReview{Repo: "go-io", PRNum: 12, Reason: "merge conflict"})
|
2026-03-24 14:24:46 +00:00
|
|
|
type PRNeedsReview struct {
|
|
|
|
|
Repo string
|
|
|
|
|
PRURL string
|
|
|
|
|
PRNum int
|
|
|
|
|
Reason string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.QueueDrained{Completed: 3})
|
2026-03-24 14:24:46 +00:00
|
|
|
type QueueDrained struct {
|
|
|
|
|
Completed int
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.PokeQueue{})
|
2026-03-24 14:24:46 +00:00
|
|
|
type PokeQueue struct{}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.SpawnQueued{Workspace: "core/go-io/task-5", Agent: "codex", Task: "review"})
|
feat(runner): extract dispatch runner into independent Core service
Moves concurrency, queue drain, workspace lifecycle, and frozen state
from agentic/prep into pkg/runner/ — a standalone Core service that
communicates via IPC Actions only.
- runner.Register wires Actions: dispatch, status, start, stop, kill, poke
- runner.HandleIPCEvents catches AgentCompleted → ChannelPush + queue poke
- Agentic dispatch asks runner for permission via c.Action("runner.dispatch")
- Dispatch mutex moved to struct-level sync.Mutex (fixes core.Lock init race)
- Registry-based concurrency counting replaces disk scanning
- TrackWorkspace called on both queued and running status writes
- SpawnQueued message added for runner→agentic spawn requests
- ChannelPush message in core/mcp enables any service to push channel events
- 51 new tests covering runner service, queue, and config parsing
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 11:00:47 +00:00
|
|
|
type SpawnQueued struct {
|
|
|
|
|
Workspace string
|
|
|
|
|
Agent string
|
|
|
|
|
Task string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.RateLimitDetected{Pool: "codex", Duration: "30m"})
|
2026-03-24 14:24:46 +00:00
|
|
|
type RateLimitDetected struct {
|
|
|
|
|
Pool string
|
|
|
|
|
Duration string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.HarvestComplete{Repo: "go-io", Branch: "agent/fix-tests", Files: 5})
|
2026-03-24 14:24:46 +00:00
|
|
|
type HarvestComplete struct {
|
|
|
|
|
Repo string
|
|
|
|
|
Branch string
|
|
|
|
|
Files int
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:30:05 +00:00
|
|
|
// c.ACTION(messages.HarvestRejected{Repo: "go-io", Branch: "agent/fix-tests", Reason: "binary detected"})
|
2026-03-24 14:24:46 +00:00
|
|
|
type HarvestRejected struct {
|
|
|
|
|
Repo string
|
|
|
|
|
Branch string
|
|
|
|
|
Reason string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-31 07:27:15 +00:00
|
|
|
// c.ACTION(messages.InboxMessage{New: 2, Total: 5})
|
2026-03-24 14:24:46 +00:00
|
|
|
type InboxMessage struct {
|
2026-03-31 07:27:15 +00:00
|
|
|
New int
|
|
|
|
|
Total int
|
2026-03-24 14:24:46 +00:00
|
|
|
}
|