Skip to content

[Agent] Expose the model on AgentInterface — what should getModel() return? #2164

Description

@tacman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AgentIssues & PRs about the AI Agent component

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions