buildSubagentEvidence (modelvalue/subagent.go)

observer · internal/intelligence/modelvalue/subagent.go · go · Apache-2.0
ai, tag:embed-classified

Computes evidence of subagent usage per session by aggregating action streams.

// Source: https://github.com/superbasedapp/observer | License: Apache-2.0 | Copyright 2026 Gaja AI
// Provided via justclaw.it.com; keep this notice with the code.
package modelvalue

import (
	"sort"

	"github.com/marmutapp/superbased-observer/internal/models"
	"github.com/marmutapp/superbased-observer/internal/routingcore"
)

// buildSubagentEvidence walks each session's action stream and
// attributes sidechain tool actions to the persona named by the most
// recent subagent_start marker (claude-code's agent-name event, the
// clinecli agent_id — both land as SubagentName on the loader's
// ActionRow). The persona's model is the dominant model of the sessions
// it ran in, weighted by attributed actions — an approximation, stated
// as such in the §R10.3 rationale, because token rows c

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key