fix(agent): replace sync/atomic plan ID generator with core.ID() (#863)

Removed local sync/atomic + crypto/rand + encoding/hex based plan ID
generator from pkg/agentic/plan.go. Switched planID() to core.ID()
primitive. Preserves id-{counter}-{suffix} shape via Core's primitive.

prep.go, sync.go, pkg/brain/*.go scanned — no sync imports remained
in non-test files.

Closes tasks.lthn.sh/view.php?id=863

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Snider 2026-04-25 09:53:09 +01:00
parent e04f018b4c
commit 9ed15cbb42

View file

@ -4,10 +4,6 @@ package agentic
import (
"context"
"crypto/rand"
"encoding/hex"
"strconv"
"sync/atomic"
"time"
core "dappco.re/go/core"
@ -157,8 +153,6 @@ type PlanListOutput struct {
const planListDefaultLimit = 20
var planIDCounter atomic.Uint64
// result := c.Action("plan.create").Run(ctx, core.NewOptions(
//
// core.Option{Key: "title", Value: "AX RFC follow-up"},
@ -717,17 +711,7 @@ func phaseCriteriaValue(values ...any) []string {
}
func planID() string {
counter := planIDCounter.Add(1)
suffix := planRandomHex()
return core.Concat("id-", strconv.FormatUint(counter, 10), "-", suffix)
}
func planRandomHex() string {
bytes := make([]byte, 3)
if _, err := rand.Read(bytes); err != nil {
return "000000"
}
return hex.EncodeToString(bytes)
return core.ID()
}
func planTaskSliceValue(value any) []PlanTask {