Problem
AgentReasoning.callLLM gives a caller no way to tag the invocation with a CognitivePhase.
AgentReasoning.kt:277-282 builds its routing context as:
RoutingContext(agentId, agentRole, requirements, workflowId = runId)
phase is left null. AgentLLMService faithfully propagates that null into the telemetry pair it emits (AgentLLMService.kt:490,526 — cognitivePhase = routingContext?.phase), and ArcTraceProjection then files the invocation under UNKNOWN (ArcTraceProjection.kt:139,393).
The result: a caller using the convenient entry point gets a trace where the model invocations are real but unattributed. Everything needed to do better is public and one layer down — it just isn't reachable from callLLM.
Why it matters
RoutingContext is a public data class with a settable phase (RoutingContext.kt:34-44), and AgentLLMService is publicly constructible with a call(prompt, systemMessage, …, routingContext) overload (AgentLLMService.kt:71-108,133-140). So the workaround is to bypass AgentReasoning and drive AgentLLMService directly — which works, but means giving up AgentReasoning's conveniences purely to set one field.
Found while scoping Socket's PROPEL trace work (SCKT-525), where Socket needs per-step invocations tagged EXECUTE. Socket is unblocked either way — it can construct AgentLLMService directly — so this is ergonomics, not a blocker. Filing it because the convenient path silently produces worse traces than the inconvenient one, which is the wrong way round.
Suggested change
An additive, default-null phase: CognitivePhase? = null parameter on AgentReasoning.callLLM, threaded into the RoutingContext it already builds. Source- and binary-compatible; no behaviour change when omitted.
Worth a look at whether AgentReasoning should instead default the phase to something more useful than null, given that docs/concepts/propel-loop.md states every model invocation should be phase-tagged.
Acceptance
callLLM can set a cognitive phase without dropping to AgentLLMService.
- An invocation made through
callLLM with a phase appears under that phase in ArcTraceProjection, not UNKNOWN.
- Omitting the parameter behaves exactly as today.
Related
SCKT-525 — Socket's PROPEL trace implementation, which is where this surfaced.
Problem
AgentReasoning.callLLMgives a caller no way to tag the invocation with aCognitivePhase.AgentReasoning.kt:277-282builds its routing context as:phaseis left null.AgentLLMServicefaithfully propagates that null into the telemetry pair it emits (AgentLLMService.kt:490,526—cognitivePhase = routingContext?.phase), andArcTraceProjectionthen files the invocation underUNKNOWN(ArcTraceProjection.kt:139,393).The result: a caller using the convenient entry point gets a trace where the model invocations are real but unattributed. Everything needed to do better is public and one layer down — it just isn't reachable from
callLLM.Why it matters
RoutingContextis a public data class with a settablephase(RoutingContext.kt:34-44), andAgentLLMServiceis publicly constructible with acall(prompt, systemMessage, …, routingContext)overload (AgentLLMService.kt:71-108,133-140). So the workaround is to bypassAgentReasoningand driveAgentLLMServicedirectly — which works, but means giving upAgentReasoning's conveniences purely to set one field.Found while scoping Socket's PROPEL trace work (
SCKT-525), where Socket needs per-step invocations taggedEXECUTE. Socket is unblocked either way — it can constructAgentLLMServicedirectly — so this is ergonomics, not a blocker. Filing it because the convenient path silently produces worse traces than the inconvenient one, which is the wrong way round.Suggested change
An additive, default-null
phase: CognitivePhase? = nullparameter onAgentReasoning.callLLM, threaded into theRoutingContextit already builds. Source- and binary-compatible; no behaviour change when omitted.Worth a look at whether
AgentReasoningshould instead default the phase to something more useful than null, given thatdocs/concepts/propel-loop.mdstates every model invocation should be phase-tagged.Acceptance
callLLMcan set a cognitive phase without dropping toAgentLLMService.callLLMwith a phase appears under that phase inArcTraceProjection, notUNKNOWN.Related
SCKT-525— Socket's PROPEL trace implementation, which is where this surfaced.