Follow-up from the review discussion on #2158.
The TUI demo needs to show an agent's model (and its capabilities), but AgentInterface exposes only call() and getName(). getModel() lives on the concrete Agent, and TraceableAgent doesn't forward it — so a decorated agent hides the model, and the demo currently has to peel decorators (unwrapAgent()) and read private properties via reflection. I'd like to remove that workaround by exposing the model on the interface so decorators can delegate.
The open question is what getModel() should return — a bare string (today's Agent::getModel(): string) feels too thin:
- A)
getModel(): ?string — the model name. Minimal, matches what's passed to Platform::invoke(), but opaque: a consumer still needs a catalog lookup to get capabilities.
- B)
getModel(): ?Model — the resolved Model (name + getCapabilities()). Richer for consumers, but Agent stores only the name today, so it would resolve name→Model via its platform's catalog.
- C) a dedicated
ModelAwareInterface implemented only by single-model agents (multi-agent orchestrators wouldn't), which avoids the nullable entirely.
Nullability is the other axis: multi-agent setups have no single model, so ? (or option C) is needed either way.
Any preference on the shape? Happy to send a focused PR once it's agreed.
Follow-up from the review discussion on #2158.
The TUI demo needs to show an agent's model (and its capabilities), but
AgentInterfaceexposes onlycall()andgetName().getModel()lives on the concreteAgent, andTraceableAgentdoesn't forward it — so a decorated agent hides the model, and the demo currently has to peel decorators (unwrapAgent()) and read private properties via reflection. I'd like to remove that workaround by exposing the model on the interface so decorators can delegate.The open question is what
getModel()should return — a barestring(today'sAgent::getModel(): string) feels too thin:getModel(): ?string— the model name. Minimal, matches what's passed toPlatform::invoke(), but opaque: a consumer still needs a catalog lookup to get capabilities.getModel(): ?Model— the resolvedModel(name +getCapabilities()). Richer for consumers, butAgentstores only the name today, so it would resolve name→Modelvia its platform's catalog.ModelAwareInterfaceimplemented only by single-model agents (multi-agent orchestrators wouldn't), which avoids the nullable entirely.Nullability is the other axis: multi-agent setups have no single model, so
?(or option C) is needed either way.Any preference on the shape? Happy to send a focused PR once it's agreed.