Skip to content

Comments

android client for pi rpc#1

Merged
ayagmar merged 154 commits intomasterfrom
develop
Feb 16, 2026
Merged

android client for pi rpc#1
ayagmar merged 154 commits intomasterfrom
develop

Conversation

@ayagmar
Copy link
Owner

@ayagmar ayagmar commented Feb 14, 2026

No description provided.

Add prompt controls for managing active streaming sessions:
- sendPrompt: send messages with automatic streaming behavior detection
- abort: cancel current agent operation
- steer: interrupt agent mid-run with new instructions
- followUp: queue messages for after agent completes

Implement streaming state tracking via AgentStartEvent/AgentEndEvent
and expose via SessionController.isStreaming StateFlow.

UI updates include:
- Input field with send button (disabled during streaming)
- Abort button (visible during streaming, red color)
- Steer and Follow Up buttons with dialog inputs
- Disabled input during streaming with clear visual feedback
Implement cycle_model and cycle_thinking_level RPC commands:
- Add CycleModelCommand and CycleThinkingLevelCommand to RpcCommand
- Add ModelInfo data class with id, name, provider, thinkingLevel
- Add cycleModel() and cycleThinkingLevel() to SessionController
- Add getState() for fetching current model/thinking on load
- Add UI controls showing current model and thinking level
- Add cycle buttons to switch models and thinking levels
- Parse model info from get_state response on initial load
- Update ChatUiState with currentModel and thinkingLevel fields
Add full support for pi extension UI protocol:
- Dialog methods: select, confirm, input, editor with response handling
- Fire-and-forget methods: notify, setStatus, setWidget, setTitle, set_editor_text
- Add ExtensionUiRequest sealed interface for dialog state management
- Add notification display via snackbars with dismiss action
- Add ExtensionUiResponseCommand for sending responses back to agent
- Implement sendExtensionUiResponse and dismissExtensionRequest in ViewModel
- Handle all extension UI events in ChatViewModel with proper state updates
Add BoundedEventBuffer for RPC event backpressure handling with capacity
limits and critical event prioritization. Buffer drops non-critical events
when full to prevent memory exhaustion during high-frequency streaming.

Add StreamingBufferManager for memory-efficient text streaming with:
- Per-message 50KB content limit (tail truncation)
- Automatic segment compaction
- LRU eviction for oldest messages
- Memory usage estimation

Add BackpressureEventProcessor for event coalescing and prioritization:
- Critical events prioritized (stream lifecycle, UI requests)
- Non-critical deltas coalesced under backpressure
- Unified ProcessedEvent sealed interface for UI consumption

Add TurnStartEvent and TurnEndEvent to RpcIncomingMessage hierarchy
for complete lifecycle tracking.

Add coroutines dependency to core-rpc for Flow-based backpressure.

All components include comprehensive unit tests.

Refs: task 6.1
Add PerformanceMetrics object for tracking key user journey timings:
- App startup to visible sessions
- Resume to first messages rendered
- Prompt to first token (TTFT)

Add FrameMetrics for UI jank detection during streaming:
- Tracks frame times via Choreographer
- Categorizes jank severity (Medium/High/Critical)
- Composables for streaming and scroll tracking

Integrate metrics into existing ViewModels:
- MainActivity records app start
- SessionsViewModel tracks resume timing
- ChatViewModel tracks prompt and first token

Add macrobenchmark module with:
- StartupBenchmark for cold start measurement
- BaselineProfileGenerator for profile generation

Add docs/perf-baseline.md documenting:
- Performance budgets and targets
- Measurement methodology
- Profiling tools and commands
- Current baseline (TBD)

Refs: task 6.2
Add README.md with:
- Project overview and architecture
- Setup instructions for laptop and phone
- Troubleshooting guide for common issues
- Development info and log locations

Add docs/final-acceptance.md with:
- Complete acceptance checklist (connectivity, chat, sessions, extensions)
- Performance criteria verification
- Quality gate status
- Architecture decisions and known limitations
- Skipped items justification (6.3, 7.1)

Update progress tracker marking 6.3 and 7.1 as SKIPPED,
8.1 and 8.2 as DONE.

Refs: tasks 8.1, 8.2
Move AI planning documents to docs/ai/:
- pi-android-rpc-client-plan.md
- pi-android-rpc-client-tasks.md
- pi-android-rpc-progress.md

Keep user-facing documentation in docs/:
- perf-baseline.md (performance targets)
- final-acceptance.md (acceptance report)

Update final-acceptance.md file tree to reflect new structure.

This separates internal planning artifacts from documentation
intended for end users and contributors.
Add docs/testing.md with:
- Emulator startup instructions (Android Studio and CLI)
- Build and install commands
- Bridge connection setup for testing
- Common issues and solutions
- Quick development cycle tips

Update README.md with link to testing guide.

Refs: user question on emulator testing
@ayagmar ayagmar merged commit 62f8d25 into master Feb 16, 2026
2 checks passed
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