Files
orca/src/shared/structured-agent-session-surface-capabilities.ts
T
Brennan Benson 3aec926fe5 Chat renames are saved as the chat's name, so Session History shows them after the tab closes (#31602)
* Chat renames are saved as the chat's name, so Session History shows them after the tab closes

Renaming a native chat tab only changed that window's tab. Session History, phones and other windows read the host's saved name, so the rename vanished from History once the tab closed or Orca restarted.

A rename now goes to the host that owns the chat (agentSession.rename) and is saved as the chat's one name, the field History, tabs, sidebars and phones already read. The record remembers that the user chose it, so automatic naming never replaces it. A window's pre-upgrade tab rename is uploaded once and only fills a name Orca chose. Hosts without the new capability keep the old tab-only rename. Every native agent's History row now shows the chat's name once it has one.

* Keep saved chat names consistent across readers and reconnects

* Carry qualified chat names into cached readers

* Reuse the history recorder context across platforms

* Use recorded chat ownership for legacy name transfer

* Transfer legacy chat names only from known catalog ownership

* Correct recorder path matching and History subscription order

* Require complete evidence for bridged parity exclusions

* Preserve sparse array lengths in complete recording comparisons

* Initialize History observation before loading workspace context

* Integrate measured History recordings and scoped parity evidence

* fix chat naming retries and certify both replay modes

* fix ambiguous chat rename labels after navigation

* preserve chat rename intent across tab updates

* type dashboard snapshot fixtures without assertions

* fix: align chat name observation with store contracts

* test: update chat name consumer fixtures

* test: distinguish sender naming metadata from status

* Preserve saved Activity chat names across tab focus

* Clarify Activity tab projection identity

* Remove package-manager lockfile churn from main merge

* fix(runtime): validate tab property edits before saving chat names

* fix: refresh History ownership after conversation clear

* fix: commit History request identity before refresh effects

* Fix History scan scope typing and integration test placement

* test: cover saved chat name reader contracts

* test: make chat naming fixtures deterministic
2026-10-25 16:20:29 -07:00

53 lines
3.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { AGENT_SESSION_PERMISSION_OWN_RUNTIME_CAPABILITY } from './agent-session-permission-modes-capability'
// Registered-agent hosts accept only their agentSession.agents inventory; offer agents beyond Claude/Codex only after negotiation.
// Clients advertising this can render those agents’ tabs; withhold extra-agent tabs from older clients to avoid empty panes.
export const STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY =
'agent-session.structured.registered-agents.v1' as const
// Pi dialog rendering/answers require a capability beyond registered-agent support.
export const PI_STRUCTURED_DIALOGS_RUNTIME_CAPABILITY =
'agent-session.structured.pi-dialogs.v1' as const
// Explicit surface holds let hosts stop children after the last visible surface closes, independently of transports.
export const STRUCTURED_AGENT_SESSION_HOLD_RUNTIME_CAPABILITY =
'agent-session.structured.hold.v1' as const
// Gate session-history tab reveal: old hosts lack the method, and its refusal is indistinguishable from a real failure.
export const STRUCTURED_AGENT_SESSION_REVEAL_RUNTIME_CAPABILITY =
'agent-session.structured.reveal.v1' as const
// Offer Regenerate name only to hosts implementing agentSession.regenerateName.
export const STRUCTURED_AGENT_SESSION_REGENERATE_NAME_RUNTIME_CAPABILITY =
'agent-session.structured.regenerate-name.v1' as const
// Save names only on rename-capable hosts; older hosts retain the local tab alias.
export const STRUCTURED_AGENT_SESSION_RENAME_RUNTIME_CAPABILITY =
'agent-session.structured.rename.v1' as const
// Negotiate resumeFrom before sending: old strict create schemas reject it, while unproven acceptance could silently start a blank chat.
export const STRUCTURED_AGENT_SESSION_RESUME_HISTORY_RUNTIME_CAPABILITY =
'agent-session.structured.resume-history.v1' as const
// Gate savedOnly because old strict catalog params reject it; otherwise preload only agents with saved picks.
export const AGENT_SESSION_MODEL_CATALOG_SAVED_ONLY_RUNTIME_CAPABILITY =
'agent-session.model-catalog.saved-only.v1' as const
/** Strict create source identity is sent only after host negotiation. */
export const STRUCTURED_AGENT_SESSION_CLI_SOURCE_RUNTIME_CAPABILITY =
'agent-session.structured.cli-source.v1' as const
// Gate the availability stream because old decoders silently drop its opcode; fall back to client facts/createSupport on click.
export const STRUCTURED_AGENT_SESSION_AVAILABILITY_RUNTIME_CAPABILITY =
'agent-session.structured.availability.v1' as const
export const AGENT_SESSION_COHERENT_MODEL_CATALOG_CAPABILITY =
'agent-session.coherent-model-catalog.v1' as const
export const STRUCTURED_AGENT_SESSION_SURFACE_RUNTIME_CAPABILITIES = [
AGENT_SESSION_PERMISSION_OWN_RUNTIME_CAPABILITY,
AGENT_SESSION_COHERENT_MODEL_CATALOG_CAPABILITY,
STRUCTURED_AGENT_SESSION_HOLD_RUNTIME_CAPABILITY,
STRUCTURED_AGENT_SESSION_REVEAL_RUNTIME_CAPABILITY,
STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY,
PI_STRUCTURED_DIALOGS_RUNTIME_CAPABILITY,
STRUCTURED_AGENT_SESSION_RESUME_HISTORY_RUNTIME_CAPABILITY,
STRUCTURED_AGENT_SESSION_CLI_SOURCE_RUNTIME_CAPABILITY,
AGENT_SESSION_MODEL_CATALOG_SAVED_ONLY_RUNTIME_CAPABILITY,
STRUCTURED_AGENT_SESSION_AVAILABILITY_RUNTIME_CAPABILITY,
STRUCTURED_AGENT_SESSION_REGENERATE_NAME_RUNTIME_CAPABILITY,
STRUCTURED_AGENT_SESSION_RENAME_RUNTIME_CAPABILITY
] as const