mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-12-03 21:17:28 +00:00
Mechanical modernization of the agent package with the gopls/go fix modernizers: range over int, strings.SplitSeq / FieldsSeq, strings.Cut / CutPrefix, slices.Contains / Sort / Backward, maps.Copy, min / max, sync.WaitGroup.Go and t.Context in tests. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
652 B
Go
23 lines
652 B
Go
package agent
|
|
|
|
import (
|
|
"context"
|
|
"strconv"
|
|
"strings"
|
|
|
|
"github.com/Autumn-27/artex/sidequestion"
|
|
"github.com/Autumn-27/norma/agentcore"
|
|
)
|
|
|
|
func attachSideCapture(ctx context.Context, opts *agentcore.Options) context.Context {
|
|
ri := RunInfoFrom(ctx)
|
|
p := sidequestion.Parent{TaskID: ri.TaskID, ExplorationID: ri.ExplorationID, IntentID: ri.IntentID}
|
|
if after, ok := strings.CutPrefix(ri.SessionID, "conv-"); ok {
|
|
p.ConversationID, _ = strconv.ParseInt(after, 10, 64)
|
|
}
|
|
if p.ConversationID == 0 && (p.TaskID == 0 || p.ExplorationID == 0) {
|
|
return ctx
|
|
}
|
|
ctx, opts.Deps = sidequestion.Attach(ctx, p, opts.Deps, opts.Provider)
|
|
return ctx
|
|
}
|