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:
parent
e04f018b4c
commit
9ed15cbb42
1 changed files with 1 additions and 17 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue