Commit Graph

4304 Commits

Author SHA1 Message Date
Mohamed Boudra
0e7c90a1c0 docs: complete tool call bottom sheet mobile web testing
Re-audited tool call sheet implementation after successful testing.
All test cases passed, edge cases handled properly, typecheck passes.
Desktop behavior noted as optional enhancement.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:29:12 +00:00
Mohamed Boudra
5f429ad91d docs: complete tool call bottom sheet mobile web testing
Verified via Playwright MCP that tool call bottom sheet works correctly:
- MCP tool calls show JSON result content
- Edit tool calls show diff with syntax highlighting
- Bash commands show command and output
- Read tool calls show file content with line numbers
- Close button and drag handle work correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:27:21 +00:00
Mohamed Boudra
a8053bc0b5 feat: integrate ToolCallSheetProvider in AgentStreamView
Wrapped AgentStreamView content with ToolCallSheetProvider to enable
tool call details to open in a bottom sheet on tap instead of expanding
inline. This improves mobile UX for viewing tool call information.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:24:07 +00:00
Mohamed Boudra
09b7360a7e feat: update ToolCall to open bottom sheet on tap
- Import useToolCallSheet hook from new tool-call-sheet component
- Replace inline expansion with openToolCall() to show details in bottom sheet
- Remove ~300 lines of unused code (toolCallStylesheet, formatFullValue,
  buildLineDiffFromStrings, isStructuredToolResult, and inline rendering)
- Clean up unused imports (ScrollView, DiffViewer, DiffLine)
- Badge display unchanged - still shows icon, label, loading/error state

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:22:29 +00:00
Mohamed Boudra
676125a732 feat: add ToolCallSheet component with bottom sheet and context
Create a new component for displaying tool call details in a bottom sheet
on mobile devices. Includes:
- ToolCallSheetProvider and useToolCallSheet hook for state management
- BottomSheetModal with snap points at 50% and 90%
- Header with tool icon, name, and status badge
- Content sections for args, commands, file diffs, file reads, and errors
- Reuses rendering logic from existing ToolCall component

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:18:10 +00:00
Mohamed Boudra
7f1a0cccf6 docs: plan tool call bottom sheet for mobile UX
Designed architecture for replacing inline tool call expansion with
bottom sheet on mobile:
- Use @gorhom/bottom-sheet (already installed)
- Create ToolCallSheet component with context for state management
- Reuse existing renderDetails logic from ToolCall component
- Snap points at 50% and 90% for flexible viewing
- Added implementation tasks and test plan

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:13:36 +00:00
Mohamed Boudra
d3823a4dbd docs: complete parentAgentId re-audit task - hierarchy verified working
- Verified MCP create_agent auto-injects parentAgentId via X-Caller-Agent-Id header
- Confirmed Sub-Agents menu correctly shows child agents with navigation
- Noted edge cases: stale data from pre-fix agents, no orphan handling
- Core hierarchy feature working for new agents, no blocking issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:10:35 +00:00
Mohamed Boudra
c7294753ec fix: resolve childAgents selector infinite loop in AgentScreenContent
The useShallow wrapper was not preventing infinite loops because the
selector created new object references on every store update. Fixed by:
1. Selecting the agents Map directly (stable reference)
2. Deriving childAgents array in useMemo with proper dependencies

The Map only changes when agents are added/removed, preventing
unnecessary re-renders that were causing the infinite loop.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:05:46 +00:00
Mohamed Boudra
6cb0322dd7 docs: complete parentAgentId debugging task - confirmed working
Added debug logging to trace the full data flow from MCP create_agent
through to toStoredAgentRecord. Testing confirmed that parentAgentId
IS being set correctly when agents are created via MCP:

- callerAgentId is correctly extracted from X-Caller-Agent-Id header
- resolvedParentAgentId is passed to agentManager.createAgent()
- config.parentAgentId is preserved through normalizeConfig()
- managed.parentAgentId is set in registerSession()
- toStoredAgentRecord() includes parentAgentId at top-level

The previous test failure was due to stale data from agents created
before the storage fix (adding parentAgentId to STORED_AGENT_SCHEMA)
was applied.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:03:53 +00:00
Mohamed Boudra
ba26f243b5 test: verify parent/child hierarchy after storage fix - partial pass
Test Results:
-  MCP header injection working (X-Caller-Agent-Id received by server)
-  Parent agent successfully creates child via MCP create_agent
-  parentAgentId not appearing at top-level of agents.json record
-  Infinite loop bug in AgentScreenContent childAgents selector

Added fix tasks for:
1. Debug why parentAgentId not preserved on ManagedAgent
2. Fix childAgents selector infinite loop

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:55:48 +00:00
Mohamed Boudra
2e8444eaac fix: add parentAgentId to stored agent record schema
- Added `parentAgentId` field to `STORED_AGENT_SCHEMA` in agent-registry.ts
- Updated `toStoredAgentRecord()` in agent-projections.ts to include parentAgentId
- This ensures parentAgentId is persisted to agents.json for parent/child hierarchy

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:47:31 +00:00
Mohamed Boudra
2d147f9a93 test: verify parent/child hierarchy after MCP fix - partial pass
Tested the MCP parent-child agent ID injection:
- X-Caller-Agent-Id header IS being sent by parent agents
- MCP server correctly receives the header and uses it as parentAgentId
- Child agents have parentAgentId stored in persistence.metadata

ISSUE FOUND: parentAgentId is missing from the top-level stored agent
record. The toStoredAgentRecord() function and STORED_AGENT_SCHEMA
don't include parentAgentId. Added fix task to plan.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:45:25 +00:00
Mohamed Boudra
b2850aea23 feat: auto-inject parentAgentId in MCP create_agent tool
When an agent calls the MCP create_agent tool to spawn a child agent,
the parent-child relationship is now automatically established:

- Added setManagedAgentId() to AgentSession interface (optional method)
- ClaudeAgentSession stores its managed agent ID and includes it as
  X-Caller-Agent-Id header when connecting to the agent-control MCP
- AgentManager.registerSession() calls setManagedAgentId() after
  registration so the session knows its ID before first prompt
- MCP server extracts X-Caller-Agent-Id header from init request and
  stores it as callerAgentId
- create_agent handler auto-injects callerAgentId as parentAgentId
  if not explicitly provided

This enables parent agents to spawn child agents that are correctly
associated, so they appear in the parent's Sub-Agents menu instead
of on the homepage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:36:58 +00:00
Mohamed Boudra
99338d3b34 fix: use useShallow for childAgents selector to prevent infinite loop
The childAgents selector in the agent screen was creating a new array
on every render, causing an infinite loop when combined with zustand's
store subscription. Added useShallow wrapper to perform shallow
comparison and prevent unnecessary re-renders.

Also updated plan.md with test results:
- PARTIAL PASS: Fixed infinite loop, agent screen loads correctly
- Sub-Agents menu section displays properly
- Parent/child MCP creation works but parentAgentId not auto-injected
- Added fix task for auto-injecting parentAgentId in MCP server

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:30:34 +00:00
Mohamed Boudra
cdc17006da feat: add sub-agents section to agent info menu
Added a "Sub-Agents" section to the agent info menu dropdown that:
- Queries session store for agents where parentAgentId matches current agent
- Displays child agents as clickable menu items with chevron icons
- Shows "No sub-agents" when the agent has no children
- Navigates to child agent screen when tapped

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:25:02 +00:00
Mohamed Boudra
11afd22858 feat: filter homepage to show only root agents
Skip agents with parentAgentId when building the aggregated agents list
for the homepage. This ensures only top-level (root) agents are displayed,
while child agents are only accessible through their parent agent's menu.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:22:42 +00:00
Mohamed Boudra
cb78f29b31 feat: add parentAgentId to client types and session store
Add parentAgentId field to:
- Agent interface in session-store.ts
- AgentDirectoryEntry in agent-directory.ts
- getAgentDirectory() includes parentAgentId
- normalizeAgentSnapshot() maps from server payload

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:21:11 +00:00
Mohamed Boudra
dd697defbb feat: add parentAgentId to MCP create_agent tool
Add parentAgentId optional parameter to the create_agent MCP tool input
schema so agents can create child agents with explicit parent references.
Also update registerSession() to copy parentAgentId from config to the
managed agent object.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:18:19 +00:00
Mohamed Boudra
a574429a7b feat: add parentAgentId field to server types
Add parentAgentId field to enable agent parent/child hierarchy:
- ManagedAgentBase in agent-manager.ts
- AgentSessionConfig in agent-sdk-types.ts
- AgentSnapshotPayloadSchema in messages.ts
- toAgentPayload() in agent-projections.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:15:29 +00:00
Mohamed Boudra
978a544f19 plan: design agent parent/child hierarchy
Design complete for agent parent/child hierarchy feature:
- parentAgentId field to track agent relationships
- MCP create_agent tool auto-sets parent from calling agent
- Homepage filters to show only root agents
- Agent menu shows sub-agents with navigation

Added implementation tasks:
- Server types (agent-manager, agent-sdk-types, agent-projections)
- MCP server integration
- Client types (session-store, agent-directory, messages)
- Homepage filtering
- Agent menu sub-agents section
- End-to-end test task
- Re-audit plan task

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:12:45 +00:00
Mohamed Boudra
07cf1baa4f test: verify git-diff screen loads correctly after infinite loop fix (PASSED)
Tested via Playwright MCP:
- Navigated to agent screen, clicked "View Changes"
- Git diff loaded successfully showing changes to plan.md
- Only one git_diff_request sent (no infinite loop)
- setGitDiffs called once and content rendered correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:09:46 +00:00
Mohamed Boudra
5d5a196525 fix: prevent infinite loop in git-diff screen
Added hasRequestedRef to track if a git diff request was already made
for the current agentId. This prevents duplicate requests when the
requestGitDiff function reference changes due to store updates.

The issue was that requestGitDiff in the useEffect dependency array
caused an infinite loop: request → store update → new function ref →
effect re-runs → request again.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:08:05 +00:00
Mohamed Boudra
6bae6f3a89 test: verify Claude agent model display behavior (PASSED)
Tested that Claude agent uses Opus 4.5 after SDK update to 0.1.75.
Agent correctly reports running on claude-opus-4-5-20251101 and
the model is properly displayed in the agent info menu.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:06:22 +00:00
Mohamed Boudra
545fad1b71 chore: update Claude Agent SDK to 0.1.75 for Opus 4.5
Updated @anthropic-ai/claude-agent-sdk from 0.1.74 to 0.1.75.
This version includes Opus 4.5 model (claude-opus-4-5-20251101).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:03:56 +00:00
Mohamed Boudra
20f94e48f7 plan: complete git diff loading investigation task
Root cause identified: Infinite loop in git-diff.tsx due to unstable
requestGitDiff function reference. The useEffect depends on this
function which changes on every store update, causing repeated
git_diff_request calls (250+ times in seconds).

Added findings section documenting:
- Data flow analysis showing the dependency chain
- The exact loop mechanism
- Console evidence (setGitDiffs/setSessionMethods called 250+ times)
- Required fix: remove requestGitDiff from useEffect dependencies

Added follow-up tasks:
- Fix task to remove unstable dependency
- Test task to verify git diff loads correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:00:55 +00:00
Mohamed Boudra
d5344af45d plan: complete model info re-audit task
Re-audit confirms all model info tracking tasks are complete:
- Claude SDK investigation found model in init message
- Implementation captures model in handleSystemMessage()
- Fixed refreshRuntimeInfo() to emit state on changes
- Both Claude and Codex agents show actual runtime models
- All tests passed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:56:35 +00:00
Mohamed Boudra
b605b53702 test: verify Claude agent model display behavior (PASSED)
Created Claude agent with "Automatic" model config. Agent correctly
self-reported running on claude-opus-4-1-20250805 (Opus 4.1), and
the agent info menu now displays the correct runtime model instead
of "Unknown". The fix for capturing model from SDK init message and
emitting state after runtimeInfo changes is working correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:55:42 +00:00
Mohamed Boudra
b1afa55778 test: verify Claude agent model display behavior (FAILED)
Created a new Claude agent with "Automatic" model config.
The agent responded correctly stating it runs on Claude Opus 4.1.
However, the model still shows "Unknown" in the agent info menu.

Root cause: The server wasn't restarted after the fix was implemented.
The dev server uses tsx with explicit restart messaging - it doesn't
auto-reload on file changes. The fix code exists in source but the
server is running stale code.

Added follow-up tasks:
- Restart server to apply model capture fix
- Re-test Claude model display after server restart

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:52:01 +00:00
Mohamed Boudra
1bf4a1d478 fix: emit state after refreshing runtime info so clients get model updates
The Claude agent model was not showing in the UI ("Model: Unknown") because
refreshRuntimeInfo() updated agent.runtimeInfo but never called emitState()
to notify connected clients of the change.

Fixed by:
1. Adding change detection in refreshRuntimeInfo() to check if model, sessionId,
   or modeId changed
2. Calling emitState(agent) when changes are detected
3. Added debug logging in handleSystemMessage() to confirm model capture

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:47:42 +00:00
Mohamed Boudra
071f83db86 test: verify Claude agent model display behavior (FAILED)
Created Claude agent with 'Automatic' model config. Agent self-reported
running on claude-opus-4-1-20250805 (Opus 4.1), but UI shows 'Model: Unknown'
in agent info menu.

The implementation to capture model from SDK init message is not working -
model is not being propagated to the UI.

Added fix task and re-test task to address the issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:43:10 +00:00
Mohamed Boudra
d46bf8c5ac test: verify Codex runtime model detection works
Tested Codex agent creation with "Automatic" model config.
After first turn completion, UI correctly displays `gpt-5.1-codex-max`
(actual runtime model from rollout file), confirming runtime model
detection is working correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:39:58 +00:00
Mohamed Boudra
e1631fcab6 feat: capture actual model from Claude SDK init message
Update handleSystemMessage() in claude-agent.ts to read the actual model
from the SDK's init message (message.model) instead of just echoing back
the configured model. This gives us the real runtime model that the SDK
selected.

Also invalidates cached runtime info when the model is updated to ensure
getRuntimeInfo() returns the new value.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:36:43 +00:00
Mohamed Boudra
845a2120ee docs: document Claude SDK model info investigation findings
Investigated @anthropic-ai/claude-agent-sdk types and found that actual
model info is exposed in two places:
1. SDKSystemMessage (init) has `model` field
2. SDKResultMessage has `modelUsage` with model names as keys

Current implementation ignores both, only using config.model.
Added implementation task to capture actual model from init message.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:34:48 +00:00
Mohamed Boudra
67fba8e96f docs: audit model info implementation and expand plan
Completed audit of current model info tracking implementation:

- Model config set via AgentSessionConfig.model
- Runtime info uses AgentRuntimeInfo type with model field
- UI correctly uses extractAgentModel() which reads runtimeInfo.model

Key findings:
- Codex agents: Correctly detect runtime model from rollout file ✓
- Claude agents: Currently echo configured model (not runtime detected)
- Gap: Claude SDK may expose actual model in response metadata

Added follow-up tasks:
- Investigate if Claude SDK exposes actual model in responses
- Test Codex runtime model detection
- Test Claude agent model display behavior
- Re-audit plan after investigation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:33:00 +00:00
Mohamed Boudra
abe3a42478 feat: add agent runtime info tracking with model detection from rollout files 2025-12-21 23:16:49 +07:00
Mohamed Boudra
a70842d9ef feat: auto-detect and use system-installed codex binary from PATH
Implements automatic detection and usage of system-installed Codex binary
with transparent fallback to embedded binary.

Changes:
- Add detectSystemCodexPath() to check for codex in PATH using `which`
- Update CodexAgentClient constructor to auto-detect system binary
- Log which binary is being used (system vs embedded) for debugging
- Preserve ability to explicitly override via codexPathOverride option

Benefits:
- No manual configuration required
- Uses latest system codex when available
- Seamless fallback to embedded binary
- Transparent to rest of codebase

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 13:30:49 +07:00
Mohamed Boudra
f06170fcee feat: upgrade codex-sdk to 0.76.0 and claude-agent-sdk to 0.1.74
Upgrade packages to access latest model catalogs:
- @openai/codex-sdk: 0.58.0 → 0.76.0
- @anthropic-ai/claude-agent-sdk: 0.1.37 → 0.1.74

New models available after upgrade:
- Claude: Added Opus 4.5 and Haiku 4.5 to catalog
- Codex: Added gpt-5.2, gpt-5.2-codex, and gpt-5.1-codex variants

Updated patch file for new codex-sdk version.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-20 13:10:57 +07:00
Mohamed Boudra
b8de55f31b Merge branch 'main' of github.com:boudra/voice-dev 2025-12-20 12:58:17 +07:00
Mohamed Boudra
fb30160cda feat: add batch clear attention and orchestrator mode instructions 2025-12-20 05:57:54 +00:00
Mohamed Boudra
5466ea1967 Merge branch 'main' of github.com:boudra/voice-dev 2025-12-20 12:57:33 +07:00
Mohamed Boudra
a6d2ea3153 fix: add input field to tool call data and simplify CLAUDE.md orchestrator docs 2025-12-20 12:56:59 +07:00
Mohamed Boudra
0f1758709d feat: add "Requires Attention" agent grouping feature
Implement a new UI section that surfaces agents requiring user attention at the top of the agent list. This includes agents that are running, have pending permissions, or have errors.

**Backend changes:**
- Add `requiresAttention` field to agent projections and SDK types
- Implement logic in AgentManager to detect attention states (running, pending permissions, errors)
- Add WebSocket message handler to notify clients of attention state changes
- Update session state to include attention tracking

**Frontend changes:**
- Add "REQUIRES ATTENTION" section in agent-list component with visual prominence
- Update useAggregatedAgents hook to expose `requiresAttention` agents
- Enhance session store to track and update attention states
- Add real-time updates via WebSocket for attention state changes
- Update type definitions across agent directory and stream types

Verified working via Playwright MCP testing on localhost:8081.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 11:27:08 +00:00
Mohamed Boudra
fd36c9b8e2 feat: add --isolated flag to Playwright MCP for Claude Code provider
Added the --isolated flag to the Playwright MCP configuration to ensure
browser instances run in isolated contexts, preventing state leakage
between different agent sessions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 23:03:45 +07:00
Mohamed Boudra
2a541d97c9 fix: capture input parameters for MCP and server tool calls
Previously, only standard tool_use blocks had their input parameters
captured in upsertToolUseEntry. MCP tools (mcp_tool_use) and server
tools (server_tool_use) were being handled for execution but their
inputs were never stored in the tool cache, resulting in missing input
data in the UI.

Now all three tool types have their inputs properly captured and
normalized, ensuring consistent tool call display across all tool types.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:55:14 +07:00
Mohamed Boudra
98c24f22a0 refactor: simplify footer architecture by removing global footer pattern
Replace portal/registry pattern with direct rendering where each screen
owns its footer. This eliminates FooterControlsContext indirection and
makes the code follow standard React composition patterns.

- Remove GlobalFooter and FooterControlsProvider from _layout.tsx
- Add HomeFooter component rendered directly in home screen
- Render AgentInputArea directly in agent screen (not via registration)
- Add keyboard animation and safe area handling to AgentInputArea
- Move FOOTER_HEIGHT constant to shared constants/layout.ts
- Delete footer-controls-context.tsx and global-footer.tsx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:25:30 +07:00
Mohamed Boudra
5cbeb97391 refactor: simplify AgentManager by removing over-engineered freeze/clone logic
Remove ReadonlyPendingPermissionsMap class and related deep cloning/freezing
methods that were causing "ManagedAgent views returned by AgentManager are
read-only" errors. The bug occurred because Map constructor internally calls
.set() which was overridden to throw.

Replace with simple shallow clones - sufficient because all consumers either
read 1-2 fields or immediately serialize via toAgentPayload() which already
creates safe copies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 21:54:55 +07:00
Mohamed Boudra
d3ad27e10a feat: improve Agent Control MCP activity endpoint with count headers
Enhance the get_agent_activity tool to provide better context about the activity list:
- Add activity count headers showing "X of Y activities"
- Remove raw format option, always use curated format for consistency
- Simplify implementation by removing unnecessary format branching
- Respect limit parameter to show most recent N activities

This makes it clearer to users when they're viewing a subset of activities versus the full list.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 21:03:48 +07:00
Mohamed Boudra
9aacc26eb6 feat: add 60-second timeout to Agent Control MCP wait operations
Implement hard-coded 60-second timeout for agent wait operations in three tools:
- create_agent (when background=false and initialPrompt provided)
- send_agent_prompt (when background=false)
- wait_for_agent (always)

When timeout occurs, returns gracefully with message "Awaiting the agent timed out, await again" instead of throwing an error. Agent continues running after timeout.

Added AGENT_WAIT_TIMEOUT_MS constant and waitForAgentWithTimeout helper function to handle timeout logic with proper cleanup and signal forwarding.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 20:53:01 +07:00
Mohamed Boudra
5f645d6b7a perf: use shallow selectors in useAggregatedAgents to reduce re-renders
Replace greedy sessions selector with granular useShallow selectors
that only extract agent Maps and methods. This prevents HomeScreen
from re-rendering on every agent stream update.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 20:47:10 +07:00
Mohamed Boudra
56e2af2308 refactor: move mode validation into AgentSession implementations
Move mode validation from AgentManager into the individual AgentSession
implementations (ClaudeAgentSession and CodexAgentSession) where it belongs.

Each session validates modes in:
- Constructor (when config.modeId is provided)
- setMode() method (when mode is changed)

This follows the principle that the AgentManager is a coordinator while
the AgentSession is the authority on what modes it supports.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 20:17:25 +07:00