Skip to content

Conversation

@gustafeden
Copy link
Collaborator

Summary

  • Adds Claude Haiku as background sidecar service for generating dynamic loading messages
  • Introduces core HaikuService infrastructure that powers all Haiku-based features
  • Enhances loading indicator with elapsed time, token count, and context-aware messages
  • Extracts MessageRenderer and SessionTokenCounter components for cleaner architecture

What's Included

Core Infrastructure (NEW)

  • lib/modules/haiku/haiku_service.dart - Core Haiku subprocess invocation
  • lib/modules/haiku/haiku_providers.dart - Riverpod state providers
  • lib/modules/haiku/message_enhancement_service.dart - Loading words generation API
  • lib/modules/haiku/prompts/loading_words_prompt.dart - Prompt for satirical loading messages

Components (NEW)

  • lib/modules/agent_network/state/agent_response_times.dart - Track response timing
  • lib/modules/agent_network/components/message_renderer.dart - Extracted message rendering
  • lib/modules/agent_network/components/session_token_counter.dart - Token usage display
  • lib/utils/code_detector.dart - Code detection utility

Modified

  • lib/components/enhanced_loading_indicator.dart - Dynamic words, elapsed time, tokens
  • lib/modules/agent_network/network_execution_page.dart - Integrates loading words
  • lib/modules/agent_network/service/agent_network_manager.dart - Generates loading words on start

User-Visible Changes

  • Loading messages now show creative, context-aware text based on user's message
  • Elapsed time displayed during agent processing (e.g., "45s")
  • Token count shown during streaming (e.g., "↓ 1.2k tokens")
  • Messages cycle every 10 seconds with shimmer animation

Test Plan

  • Send a message and verify dynamic loading words appear
  • Verify elapsed time increments during processing
  • Verify token count updates during streaming
  • Verify fallback messages work when Haiku unavailable/times out

🤖 Generated with Claude Code

Add the core Haiku infrastructure for background Claude Haiku tasks:
- HaikuService: Core service for spawning Claude Haiku processes
- HaikuProviders: Riverpod state providers for various Haiku features
- MessageEnhancementService: Service for loading words generation
- LoadingWordsPrompt: Prompt builder for creative loading messages

Add supporting components:
- AgentResponseTimes: Track response timing for elapsed time display
- MessageRenderer: Extracted component for rendering conversation messages
- SessionTokenCounter: Display session token usage
- CodeDetector: Utility for detecting code in messages

Update existing components:
- EnhancedLoadingIndicator: Add elapsed time, token count, dynamic words
- NetworkExecutionPage: Integrate loading words and response timing
- AgentNetworkManager: Generate loading words on new network start

This extracts the loading message states feature from the feature branch
while excluding idle detection, activity tips, and code sommelier calls.
@gustafeden gustafeden force-pushed the feature/haiku-core-clean branch from abbdb95 to 92c779f Compare January 7, 2026 09:26
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.

1 participant