- Add ensureRepoWorkspace() function to clone and checkout repos
- Uses gh CLI for authenticated cloning with git fallback
- Automatically fetches latest changes and checks out specified branch
- Stores repos in ~/clawd/.workspaces/{owner}/{repo}
- Agent command now uses repo workspace when repoContext is provided
- Falls back to standard agent workspace when no repoContext
This enables the mobile app to specify a GitHub repository context,
and the agent will automatically clone it and work within that repo
instead of the default agent workspace.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add repoContext parameter to Gateway agent method
- Update AgentParamsSchema to include repoContext (owner/name/branch)
- Add repoContext to AgentCommandOpts type
- Pass repoContext through gateway to agent command
- Fix streaming implementation with proper enum usage (MessageRole, ToolCallStatus)
- Add disabled prop to MessageInputView
- Clean up lint issues (remove unused imports)
The mobile app can now send repository context (owner/repo/branch) when starting
a coding session. The gateway will receive this context and pass it to the agent
command, preparing for workspace clone/checkout implementation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add GitHub API service for fetching user repos and branches
- Add settings view for GitHub username and gateway URL
- Update NewSessionSheet to use real GitHub data
- Add Gateway WebSocket client for real-time communication
- Add useGateway hook for agent event streaming
- Prepare for real-time tool call streaming in ChatView
Co-Authored-By: Claude <noreply@anthropic.com>
Port of SwiftUI iOS app to Expo/React Native for cross-platform support.
- Session list with repository info and status
- Chat view with collapsible tool executions
- Message input with model/repo/branch selection chips
- PR creation flow simulation
- Dark theme matching Claude Code aesthetic
- KeyboardAvoidingView for proper keyboard handling
https://claude.ai/code/session_018qmTB96S8xvNRQFrhcvzJp
- Create new iOS app at apps/ios-github-mobile
- Session list view with repository info and status
- Chat view with collapsible tool executions (Write, Bash, Read)
- Message input with model/repo/branch selection chips
- PR creation flow simulation
- Dark theme matching Claude Code aesthetic
- Mock data for repos, sessions, and tool calls
- Modern SwiftUI with @Observable, NavigationStack
https://claude.ai/code/session_018qmTB96S8xvNRQFrhcvzJp
Adds sanitization to extractAssistantText in sessions-helpers.ts to
prevent tool call text from leaking to users. Previously, messages
retrieved from chat history via sessions-helpers.ts could expose:
- Minimax XML tool calls (<invoke>...</invoke>)
- Downgraded tool call markers ([Tool Call: name (ID: ...)])
- Thinking tags (<think>...</think>)
This fix:
- Exports the stripping functions from pi-embedded-utils.ts
- Adds a new sanitizeTextContent helper in sessions-helpers.ts
- Updates extractAssistantText to sanitize before returning
- Updates extractMessageText in commands-subagents.ts to sanitize
Fixes#1269
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ui): allow relative URLs in avatar validation
The isAvatarUrl check only accepted http://, https://, or data: URLs,
but the /avatar/{agentId} endpoint returns relative paths like /avatar/main.
This caused local file avatars to display as text instead of images.
Fixes avatar display for locally configured avatar files.
* fix(gateway): resolve local avatars to URL in HTML injection and RPC
The frontend fix alone wasn't enough because:
1. serveIndexHtml() was injecting the raw avatar filename into HTML
2. agent.identity.get RPC was returning raw filename, overwriting the
HTML-injected value
Now both paths resolve local file avatars (*.png, *.jpg, etc.) to the
/avatar/{agentId} endpoint URL.
* feat(compaction): add adaptive chunk sizing and progressive fallback
- Add computeAdaptiveChunkRatio() to reduce chunk size for large messages
- Add isOversizedForSummary() to detect messages too large to summarize
- Add summarizeWithFallback() with progressive fallback:
- Tries full summarization first
- Falls back to partial summarization excluding oversized messages
- Notes oversized messages in the summary output
- Add SAFETY_MARGIN (1.2x) buffer for token estimation inaccuracy
- Reduce MIN_CHUNK_RATIO to 0.15 for very large messages
This prevents compaction failures when conversations contain
unusually large tool outputs or responses that exceed the
summarization model's context window.
* feat(ui): add compaction indicator and improve event error handling
Compaction indicator:
- Add CompactionStatus type and handleCompactionEvent() in app-tool-stream.ts
- Show '🧹 Compacting context...' toast while active (with pulse animation)
- Show '🧹 Context compacted' briefly after completion
- Auto-clear toast after 5 seconds
- Add CSS styles for .callout.info, .callout.success, .compaction-indicator
Error handling improvements:
- Wrap onEvent callback in try/catch in gateway.ts to prevent errors
from breaking the WebSocket message handler
- Wrap handleGatewayEvent in try/catch with console.error logging
to isolate errors and make them visible in devtools
These changes address UI freezes during heavy agent activity by:
1. Showing users when compaction is happening
2. Preventing uncaught errors from silently breaking the event loop
* fix(control-ui): add agentId to DEFAULT_ASSISTANT_IDENTITY
TypeScript inferred the union type without agentId when falling back to
DEFAULT_ASSISTANT_IDENTITY, causing build errors at control-ui.ts:222-223.