Skip to content

refactor(ai_assistant): retire the Familiar agent panel (DRAFT — needs focus dogfood)#218

Merged
BunsDev merged 6 commits into
mainfrom
refactor/retire-familiar-panel
Jul 18, 2026
Merged

refactor(ai_assistant): retire the Familiar agent panel (DRAFT — needs focus dogfood)#218
BunsDev merged 6 commits into
mainfrom
refactor/retire-familiar-panel

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 18, 2026

Copy link
Copy Markdown
Member

Description

DRAFT — needs live dogfooding of workspace focus before merge.

Retires the ai_assistant "Familiar" agent panel, per specs/castcodes-unified-agent-panel/PLAN-2d-task4-familiar-retirement.md (v2, scope A). The unified agent_panel (default since #216) is now the agent surface; this removes the superseded Familiar UI.

Approach — data-vs-UI extraction, not a plain deletion. The Familiar panel was a circular knot (panel.rs ↔ transcript.rs ↔ utils.rs) fused to the AI server-API data layer. So:

  • Extract the AI-dialogue data types (TranscriptPart & friends, markdown_segments_from_text, CodeBlockMouseStateHandles) into a new UI-free ai_assistant/dialogue_types.rs; repoint server_api/ai.rs + requests.rs to it. dialogue_types.rs imports only warpui/markdown_parser leaf types — no panel/transcript/AIAssistantAction.
  • Delete the UI knot: panel.rs, transcript.rs, coven_stream_persist.rs (orphaned), and the UI half of utils.rs (which became fully orphaned → removed). AIAssistantAction deleted.
  • Unwire from the workspace: the field/construct/toggle/handler/event-handler/render, ToggleAIAssistant + ClickedAIAssistantIcon actions, the !AgentMode keybinding (the NewPaneInAgentMode binding on the same id stays), is_ai_assistant_panel_open state, panel::init, ~25 focus sites, and the test fixtures.

Kept (used app-wide): execution_context, coven_entry (unified panel uses it), requests.rs (server_api/auth), AskAIType + AI_ASSISTANT_* constants. Agent Mode untouched.

Scope expansions (cascade of deleting the panel — call out for review)

  • utils.rs deleted entirely (renamed to dialogue_types.rs after extraction; the leftover UI helpers were orphaned).
  • Warm-welcome onboarding removed — it only onboarded users into the Familiar panel and its handlers called the removed toggle.
  • ask_ai_assistant is now a no-op in the non-Agent-Mode path (the old panel entry). Agent Mode is default-on, so the block/selection "Ask AI" Agent-Mode path (terminal::view::ask_ai) is unchanged; the legacy non-agent affordance no longer does anything.
  • Rebrand-guard test: castcodes_public_surface_tests.rs include_str!'d the deleted panel.rs; its 4 Coven-wiring assertions (COVEN_CODE_HARNESS, send_via_coven_gateway_with_prompt, …) were removed with it. Follow-up: add equivalent fork-local guards on the unified agent_panel.
  • Removed the (already-#[ignore]'d) Familiar integration test + its registration.

Testing (independently verified, not just the author's claim)

  • cargo clippy -p warp-app --features cast-agent --all-targets -- -D warningsclean
  • cargo clippy -p warp-app --features cast-agent,unified_agent_panel --all-targets -- -D warningsclean
  • cargo nextest … -E 'test(ai_assistant|workspace|agent_panel|server|cli_chat|dialogue_types|castcodes_public_surface)'427 passed, 0 failed
  • Release-config compile (./script/bundle --channel oss --nouniversal --check-only) — release-lto Finished, server_api compiles
  • ./script/check_cli_chat_boundary / check_ai_attribution / check_rebrand — pass. No dangling panel references remain.

Needs your dogfood (an agent can't verify these)

  1. Workspace focus after removing ~25 AI-panel focus/state branches — verify left/right-panel + tab navigation still route correctly (terminal ↔ Drive ↔ theme chooser ↔ resource center). Focus tests that referenced the panel were removed, so this path lost some coverage.
  2. Non-Agent-Mode "Ask AI" (ctrl-shift-space) is now a no-op — confirm that's intended.
  3. workspace:toggle_ai_assistant now binds only NewPaneInAgentMode (Agent-Mode-gated) — confirm no keybinding regression with Agent Mode disabled.

Linked Issue

Executes the v2 plan (in main via #217). Roadmap: #204/#205/#209/#210/#213/#214/#216.

Agent Mode

BunsDev added 6 commits July 18, 2026 12:52
Move TranscriptPart and its supporting AI-dialogue data types
(FormattedTranscriptMessage, AssistantTranscriptPart, MarkdownSegment,
CodeBlockIndex, TranscriptPartSubType, CodeBlockMouseStateHandles,
markdown_segments_from_text) out of the Familiar panel's utils/transcript
UI knot into a new UI-free module, ai_assistant::dialogue_types.

This lets server_api/ai.rs and ai_assistant::requests depend on the
dialogue data layer without pulling in the AIAssistantPanelView, which is
being retired. utils re-exports the types for the still-present panel UI.

Tests move to dialogue_types_tests.rs.
Remove the AIAssistantPanelView wiring from the workspace ahead of
deleting the panel itself: the ToggleAIAssistant/ClickedAIAssistantIcon
actions and their warm-welcome siblings, the Familiar EditableBinding
(keeping the NewPaneInAgentMode binding on the shared
workspace:toggle_ai_assistant id), the panel::init call, and every
ai_assistant_panel field, event handler, focus/state site, the legacy
tab-bar entry-point button, and the warm-welcome onboarding popup.

The panel is now treated as permanently closed; the AskAIType flow is
preserved (Agent Mode path is unaffected) and ask_ai_assistant is a
no-op for the retired legacy path. WorkspaceState::is_ai_assistant_panel_open
is removed.
Delete the AIAssistantPanelView (panel.rs), the Transcript view
(transcript.rs) and its tests, the orphaned coven_stream_persist.rs, and
the now-orphaned utils.rs (its UI-free dialogue types already moved to
dialogue_types; its render_* helpers and AIAssistantAction were
panel-only). Drop the panel/transcript/coven_stream_persist/utils module
declarations.

Gate the now-unused OPENCOVEN_SUCCESS/OPENCOVEN_WARNING brand colours
(previously the panel's Coven Gateway status pills) with allow(dead_code),
matching OPENCOVEN_MUTED.
Remove the ai_assistant_panel_view() integration getter and the Familiar
panel integration test (test_ask_warp_ai_keybinding_for_selected_block,
its module, registration, and nextest wrapper), the Familiar focus-panel
assertions in workspace view_tests, and the panel.rs source-include from
the CastCodes public-surface rebrand guard (the panel file is deleted).
@BunsDev
BunsDev marked this pull request as ready for review July 18, 2026 19:50
Copilot AI review requested due to automatic review settings July 18, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Retires the legacy ai_assistant “Familiar” panel UI and related workspace wiring, while extracting the still-needed AI dialogue data types into a UI-free module so server_api / auth paths no longer depend on the removed panel code.

Changes:

  • Removed Familiar panel UI (panel/transcript), its workspace state/focus paths, warm-welcome onboarding, actions, and integration-test fixtures.
  • Extracted AI dialogue/transcript data types into ai_assistant/dialogue_types.rs and repointed requests.rs + server_api/ai.rs to the new module.
  • Updated fork-local public-surface guards to target the unified agent_panel sources instead of the retired Familiar panel source.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/integration/tests/integration/ui_tests.rs Drops the ignored Familiar keybinding test from the integration test list.
crates/integration/src/test/ai_assistant.rs Deletes the Familiar “Ask AI from selected block” integration test implementation.
crates/integration/src/test.rs Removes the ai_assistant integration-test module and re-exports.
crates/integration/src/bin/integration.rs Unregisters the removed Familiar integration test.
app/src/workspace/view.rs Removes Familiar panel state/render/focus and makes legacy ask_ai_assistant a no-op.
app/src/workspace/view_tests.rs Removes focus-switching assertions that depended on the Familiar panel/warm-welcome.
app/src/workspace/util.rs Removes is_ai_assistant_panel_open and related mouse state from workspace state.
app/src/workspace/mod.rs Removes the non-Agent-Mode “Toggle Familiar” binding and leaves only the Agent Mode entrypoint binding.
app/src/workspace/action.rs Removes Familiar toggle/warm-welcome actions from WorkspaceAction.
app/src/server/server_api/ai.rs Switches transcript type imports to ai_assistant::dialogue_types.
app/src/lib.rs Stops initializing the retired Familiar panel.
app/src/integration_testing/view_getters.rs Removes the integration-testing getter for the deleted Familiar panel view.
app/src/castcodes_public_surface_tests.rs Moves fork-local Coven wiring/label guards from ai_assistant/panel.rs to unified agent_panel sources.
app/src/ai/coven_brand.rs Adds #[allow(dead_code)] to brand colors that became unused after panel retirement.
app/src/ai_assistant/transcript.rs Deletes the Familiar transcript view implementation.
app/src/ai_assistant/transcript_tests.rs Deletes transcript navigation unit tests tied to the removed view.
app/src/ai_assistant/test_util.rs Repoints test utilities to dialogue_types types.
app/src/ai_assistant/requests.rs Repoints transcript types + markdown segmentation helpers to dialogue_types.
app/src/ai_assistant/panel.rs Deletes the Familiar panel implementation (including coven stream UI plumbing).
app/src/ai_assistant/mod.rs Removes the retired UI modules and exports the new dialogue_types module.
app/src/ai_assistant/dialogue_types.rs New UI-free transcript/markdown segment data types extracted from the old UI knot.
app/src/ai_assistant/dialogue_types_tests.rs Renames/ports the old utils tests to target dialogue_types.
app/src/ai_assistant/coven_stream_persist.rs Deletes now-orphaned coven stream history persistence (previously tied to the Familiar panel).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/workspace/mod.rs
Comment on lines 1209 to 1210
// We use the same binding name for the AI Assistant and block list AI to preserve custom
// keybindings between them.
Comment thread app/src/workspace/view.rs
Comment on lines +16076 to +16080
fn ask_ai_assistant(&mut self, _ask_type: &AskAIType, _ctx: &mut ViewContext<Self>) {
// The legacy Familiar (AI assistant) panel has been retired. The unified
// agent panel is now the default agent surface, so this legacy
// non-agent-mode entry point is a no-op. The `AskAIType` flow itself is
// preserved for the Agent Mode path handled elsewhere.
@BunsDev
BunsDev merged commit f99ee6d into main Jul 18, 2026
33 of 34 checks passed
@BunsDev
BunsDev deleted the refactor/retire-familiar-panel branch July 18, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants