> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase40-session11-chat-model-selector-and-context-meter/tasks.md).

# Task Checklist

**Session ID**: `phase40-session11-chat-model-selector-and-context-meter` **Total Tasks**: 19 **Estimated Duration**: 3-4 hours **Created**: 2026-07-03

***

Legend: `[x]` completed; `[ ]` pending; `[P]` parallelizable; `[SNNMM]` session ref; `TNNN` task ID.

***

## Setup (2 tasks)

* [x] T001 \[S4011] Verify existing Hermes model and chat override contracts before edits (`src/lib/hermes-types.ts`, `src/hooks/use-hermes-admin.ts`)
* [x] T002 \[S4011] Wire the Hermes models view into chat tab call sites with safe optional test defaults (`src/components/hermes/hermes-read-only-page.tsx`, `src/components/knowledge-graph/knowledge-graph-grounded-chat.tsx`, `src/components/hermes/chat/hermes-chat-tab.tsx`)

***

## Foundation (4 tasks)

* [x] T003 \[S4011] \[P] Add shared selected-model and context-estimate chat types with declared-contract coverage points (`src/components/hermes/chat/chat-types.ts`)
* [x] T004 \[S4011] \[P] Create the controlled model selector with configured-provider filtering, MoA rows, explicit loading/empty/error/offline states, and accessible interaction labels (`src/components/hermes/chat/model-selector.tsx`)
* [x] T005 \[S4011] \[P] Create the context meter with approximate draft/conversation estimates, fallback context source labels, a 100-cell popover breakdown, and stable dimensions (`src/components/hermes/chat/context-meter.tsx`)
* [x] T006 \[S4011] Export new chat components and shared types through the local chat barrel (`src/components/hermes/chat/index.ts`)

***

## Implementation (7 tasks)

* [x] T007 \[S4011] Add active model state to `HermesChatTab` with default selection and revalidation when model data changes (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T008 \[S4011] Integrate selector and context meter into the composer toolbar with product-facing copy only and responsive constraints that prevent overlap (`src/components/hermes/chat/chat-composer.tsx`)
* [x] T009 \[S4011] Send ordinary selected model/provider options through the existing chat action with duplicate-trigger prevention while in-flight (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T010 \[S4011] Send MoA preset selections as provider `moa` with preset name model through the existing chat action (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T011 \[S4011] Merge selected model/provider options with existing grounding graph/toolset options without mutating Hermes config (`src/components/hermes/chat/hermes-chat-tab.tsx`, `src/components/hermes/chat/chat-types.ts`)
* [x] T012 \[S4011] Preserve demo/read-only and model-data failure states without exposing raw bridge diagnostics (`src/components/hermes/chat/model-selector.tsx`, `src/components/hermes/chat/context-meter.tsx`)
* [x] T013 \[S4011] Update page-level chat wiring and direct chat-tab contract usage for the new model-aware props (`src/components/hermes/hermes-read-only-page.tsx`, `src/components/knowledge-graph/knowledge-graph-grounded-chat.tsx`, `src/components/hermes/__tests__/hermes-sections.test.tsx`)

***

## Testing (6 tasks)

* [x] T014 \[S4011] Add Hermes chat model fixtures for configured providers, unconfigured providers, fallback context, and MoA mixtures (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T015 \[S4011] \[P] Test selector defaults, configured-provider filtering, MoA row visibility, and accessible control labels (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T016 \[S4011] \[P] Test context meter draft updates, selected-session message estimates, fallback context labels, and 100-cell breakdown rendering (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T017 \[S4011] Test ordinary, MoA, and grounded-chat send payloads for selected model/provider option merging (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T018 \[S4011] Run focused compatibility tests for admin chat payload validation and Hermes model parsing (`src/hooks/__tests__/use-hermes-admin.test.tsx`, `src/lib/__tests__/hermes-types.test.ts`)
* [x] T019 \[S4011] Run required focused checks and ASCII/LF validation for touched files (`bun run test -- src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx src/hooks/__tests__/use-hermes-admin.test.tsx src/lib/__tests__/hermes-types.test.ts`, `bun run typecheck`, `perl -ne 'exit 1 if /[^\x00-\x7F]/' .spec_system/specs/phase40-session11-chat-model-selector-and-context-meter/spec.md .spec_system/specs/phase40-session11-chat-model-selector-and-context-meter/tasks.md`)

***

## Completion Checklist

* [x] All tasks marked `[x]`
* [x] All tests and checks passing
* [x] All files ASCII-encoded with LF line endings
* [x] implementation-notes.md updated
* [x] Ready for `creview` (next step in the implement -> creview -> validate sequence)

***

## Next Steps

Run the `implement` workflow step.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase40-session11-chat-model-selector-and-context-meter/tasks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
