# \[Agent Session\] \`session.run\` Does Not Return the Actual Model, Making the Final Model Route Impossible to Verify

**URL:** <https://forum.anna.partners/t/agent-session-session-run-does-not-return-the-actual-model-making-the-final-model-route-impossible-to-verify/270>\
**Category:** Developers\
**Created:** [August 28, 2026, 1:45am UTC](https://forum.anna.partners/t/agent-session-session-run-does-not-return-the-actual-model-making-the-final-model-route-impossible-to-verify/270 "2026-08-28T01:45:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HappyLight](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@HappyLight](https://forum.anna.partners/u/HappyLight)\
**Post date:** [August 28, 2026, 1:45am UTC](https://forum.anna.partners/t/agent-session-session-run-does-not-return-the-actual-model-making-the-final-model-route-impossible-to-verify/270/1 "2026-08-28T01:45:25Z")

</div>

## Summary

I tested the following APIs directly through the Anna App Runtime:

- Create an `agent.session`;
- Run one request through that Session with `agent.session.run`;
- Run one `llm.complete` request for comparison.

The `llm.complete` response includes the actual model used, but the Agent Session create response, run acknowledgement, and stream frames from this run did not include an actual model field. As a result, the client can only see the model preference submitted in the request and cannot verify which model the server ultimately routed the request to.

## Reproduction details

The test was performed in an Anna App local development environment, using the same user permissions and a simple text prompt. The examples below are the key RPC requests, responses, and stream frames captured by the client.

The Session was created with:

```json
{
  "submode": "auto",
  "quotaCaps": {
    "inherit_host_tools": false,
    "allowed_tools": ["fs_read_file"]
  }
}

```

The subsequent `agent.session.run` request was:

```json
{
  "app_session_uuid": "aps_kc4qbtiyfuktndila26hbs",
  "content": "hi",
  "modelPreferences": {
    "hints": [
      { "name": "google/gemini-3-flash-preview" }
    ]
  }
}

```

## Session responses observed

### 1. `agent.session.create` response

```json
{
  "app_session_uuid": "aps_kc4qbtiyfuktndila26hbs",
  "expires_in": 600,
  "submode": "auto",
  "fixed_client_id": null,
  "granted_tools": []
}

```

There is no `model` or `model_name` field. This is understandable because no model inference has been executed at the time the Session is created.

### 2. Immediate `agent.session.run` response

```json
{
  "stream_id": "dev-1",
  "run_id": "dev-1"
}

```

This response only provides stream and run identifiers; it does not include model information.

### 3. `agent.session.run` stream frames

The `run_meta` frame received when execution started was:

```json
{
  "event": "run_meta",
  "run_id": "6ce81be3-a162-4d51-aabd-603d86fda4ae",
  "app_session_uuid": "aps_kc4qbtiyfuktndila26hbs",
  "submode": "auto",
  "inherit_host_tools": false,
  "granted_tools": ["fs_read_file"]
}

```

The task completion frame contained token usage:

```json
{
  "task_complete": {
    "task_id": "95a86d5a-4213-470e-8f35-d174a61d7b47",
    "status": "completed",
    "token_usage": {
      "total_calls": 1,
      "total_prompt_tokens": 317,
      "total_completion_tokens": 9,
      "total_tokens": 326,
      "total_estimated_cost": 0.000186,
      "agent_turn_id": "e9ef90ff-589"
    }
  }
}

```

Neither `run_meta` nor `task_complete` contains `model` or `model_name`. The final text frame only contains the generated content:

```json
{
  "choices": [
    {
      "delta": {
        "content": "Hello! How can I help you today?"
      }
    }
  ],
  "event": "sse"
}

```

## Comparison: `llm.complete` returns the actual model

For the same input, `hi`, the `llm.complete` response included:

```json
{
  "role": "assistant",
  "content": {
    "type": "text",
    "text": "Hello! How can I help you today?"
  },
  "model": "google/gemini-3-flash-preview",
  "stopReason": "endTurn",
  "usage": {
    "inputTokens": 1,
    "outputTokens": 9,
    "totalTokens": 10
  },
  "_meta": {
    "provider": "openrouter",
    "latencyMs": 1036,
    "quotaConsumed": 0.023275862068965515,
    "appSessionUuid": "aps_hq33od2vzgapjnbtfaxzhc"
  }
}

```

This response explicitly reports `model: "google/gemini-3-flash-preview"`.

The following field in the Session request:

```json
"modelPreferences": {
  "hints": [{ "name": "google/gemini-3-flash-preview" }]
}

```

only represents the model preference submitted by the client. It is not equivalent to the model ultimately used by the server. Routing may be affected by user authorization, model availability, or other server-side policies. If the server performs a fallback, the client currently has no way to detect it from the Session response.

Also, the `appSessionUuid` in the `llm.complete` response (`aps_hq33...`) is different from the raw Agent Session’s `app_session_uuid` (`aps_kc4q...`). Therefore, the model returned by `llm.complete` cannot be used to infer the actual model used by the raw Agent Session.

## Impact

Without the actual model information, it is difficult to:

1. Verify whether `modelPreferences` was honored;
2. Detect model fallback or routing discrepancies;
3. Reliably associate token usage, latency, and cost with a specific model;
4. Debug output differences between models using server-side execution data rather than only the request parameters;
5. Perform production auditing and troubleshooting with complete runtime metadata.

## Expected behavior

Please expose the actual model used for every `agent.session.run`, in at least one of the following locations:

- `run_meta.model` or `run_meta.model_name`;
- `task_complete.model` or `task_complete.model_name`;
- A standardized model field in the final completion frame.

It would also be helpful if the documentation clarified:

1. Whether `modelPreferences.hints` is a preference or a hard requirement;
2. Whether fallback is allowed when the preferred model cannot be used;
3. Which frame contains the actual model, including the field name and format;
4. Whether an explicit “model unavailable” or “model not disclosed” status can be returned when the model cannot be exposed for policy reasons.

Since `llm.complete` already returns `model`, providing equivalent actual-model metadata for Agent Sessions would make the two invocation paths much easier to observe and troubleshoot consistently.

## Correlation identifiers

The following identifiers may help with server-side investigation:

- `app_session_uuid`: `aps_kc4qbtiyfuktndila26hbs`
- `stream_id`: `dev-1`
- `run_id` (from the `run_meta` frame): `6ce81be3-a162-4d51-aabd-603d86fda4ae`
- `task_id`: `95a86d5a-4213-470e-8f35-d174a61d7b47`
- `agent_turn_id`: `e9ef90ff-589`

I can provide the complete raw RPC log if needed.

---

<div class="post-metadata">

**Author:** ![hunter](https://yyz1.discourse-cdn.com/flex033/user_avatar/forum.anna.partners/hunter/32/8_2.png) [@hunter](https://forum.anna.partners/u/hunter)\
**Post date:** [September 8, 2026, 8:35am UTC](https://forum.anna.partners/t/agent-session-session-run-does-not-return-the-actual-model-making-the-final-model-route-impossible-to-verify/270/2 "2026-09-08T08:35:30Z")

</div>

Hi @HappyLight! 👋

Thank you for this wonderfully detailed report — the captured frames and correlation IDs made it a breeze to trace. You’re absolutely right: there was no way to verify the final model route from an Agent Session, and that’s now fixed! 🎉

## ✅ What’s coming in `1.1.0-beta.155`

**Every `agent.session.run` now discloses the actually-routed model in two places:**

1. **`run_meta` frame** — now carries `model` and `provider`:

2. **`task_complete` delta** — echoes the same `model` / `provider` alongside `token_usage`, so usage, latency, and cost can be attributed to a specific model:

The `model` value follows the exact same naming convention as `llm.complete`’s `model` field — the two paths are now consistent and auditable. ✨

## 📖 Your documentation questions — answered (and now in the docs!)

1. **Is `modelPreferences.hints` a preference or hard requirement?** A _soft_ preference — it nudges the router but never fails the run.
2. **Is fallback allowed?** Yes — if the hinted model can’t be used (availability, authorization, etc.), the server falls back rather than failing your run. The new fields make any fallback visible.
3. **Which frame contains the actual model?** Both `run_meta` (pre-token, authoritative) and `task_complete` (terminal, for accounting).
4. **“Model not disclosed” status?** Not needed — the routed model is always disclosed, same as `llm.complete`.

The Host API reference for `agent.session.run` has been updated with all of the above, and the `anna-app-llm-demo` / `anna-app-session-demo` examples now display the routed model too. 📚

## 🗓 Rollout

Shipping to production **this Friday**. The change is fully backward-compatible — the new fields simply appear on existing frames, nothing else about the stream shape changes.

Thanks again for pushing the platform’s observability forward — reports like this one are exactly what makes the developer experience better for everyone. Happy building! 💛
