> 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/phases/phase_40/session_12_compact_and_chat_polish.md).

# Session 12: Compact And Chat Polish

**Session ID**: `phase40-session12-compact-and-chat-polish` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Port compact, copy, thinking-state, warning-filter, and label polish in the existing split chat implementation.

***

## Scope

### In Scope (MVP)

* Implement compact as a normal Hermes summary request followed by a fresh local chat with visible carryover bound to the active chat instance.
* Prevent carryover from leaking into a different chat or loaded session.
* Add reply copy controls using local button and icon patterns.
* Add a "Hermes is thinking" elapsed state before first output.
* Narrow startup-warning stripping so legitimate model replies beginning with "Warning:" are not hidden.
* Keep "Hermes Intelligence" as the portal/surface name and use "Voice" only for speech-specific controls and recovery copy.

### Out of Scope

* Command endpoint implementation.
* Renaming the Intelligence portal to Voice.
* Claiming compaction exactly reclaims context unless Hermes behavior proves it.

***

## Prerequisites

* [ ] Session 04 chat runtime behavior is available.
* [ ] Session 11 selector/context layout is available or coordinated.

***

## Deliverables

1. Compact flow with carryover isolation.
2. Copy reply, thinking timer, and warning-filter polish.
3. Tests for compact carryover isolation, copy button rendering, elapsed state, and warning stripping.

***

## Success Criteria

* [ ] Compact creates a summary and fresh chat without cross-chat leakage.
* [ ] A legitimate model response that starts with `Warning:` is not stripped.
* [ ] Copy and thinking states do not create layout shift or overlap.
* [ ] Intelligence and Voice labels match AI OS product language.

***

## Folded Source Session Split

The section below preserves the original Phase 40 session split detail for this session, including dependencies, decisions, outputs, and acceptance checks.

### Session 12: Compact And Chat Polish

**Objective**: Port compact, copy, thinking-state, warning-filter, and label polish in the existing split chat implementation.

**Scope**:

* Implement compact as a normal Hermes summary request followed by a fresh local chat with visible carryover bound to the active chat instance.
* Prevent carryover from leaking into a different chat or loaded session.
* Add reply copy controls using local button/icon patterns.
* Add a "Hermes is thinking" elapsed state before first output.
* Narrow startup-warning stripping so legitimate model replies beginning with "Warning:" are not hidden.
* Keep "Hermes Intelligence" as the portal/surface name because AI OS uses it for typed, spoken, and visual reasoning. Use "Voice" only for speech-specific controls and recovery copy. Defer docs updates to Session 17.

**Outputs**:

* Compact flow with carryover isolation.
* Copy reply, thinking timer, and warning-filter polish.
* Tests for compact carryover isolation, copy button rendering, elapsed state, and warning stripping.

**Dependencies / Notes**:

* Depends on Sessions 04 and 11.
* Decision: do not rename the portal to Voice. The upstream label change is narrower than AI OS's shipped Intelligence portal.

**Acceptance Checks**:

* Compact creates a summary and fresh chat without cross-chat leakage.
* A legitimate model response that starts with `Warning:` is not stripped.
* Copy and thinking states do not create layout shift or overlap.


---

# 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/phases/phase_40/session_12_compact_and_chat_polish.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.
