Skip to content

Conversation

@Diplow
Copy link
Owner

@Diplow Diplow commented Dec 18, 2025

No description provided.

Diplow and others added 18 commits December 15, 2025 17:39
…y to Hexplan

- Add deleteHexplan parameter to hexecute endpoint (defaults to false)
- When true, removes all hexplan tiles before proceeding (uses existing removeChildrenByType)
- Update hexrun command to use deleteHexplan:true for sync agent
- Add root_coords parameter to Sync Agent tile
- Rename all ExecutionHistory/ExecHistory references to Hexplan across UI
- Add ancestor context drilling to hexecute prompts (top-down content flow)
- Add root hexplan generation with all leaf tasks listing

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The hexecute endpoint was using publicProcedure which doesn't validate
API keys. When MCP tools called hexecute with an API key, the user was
treated as anonymous and private tiles were filtered out.

Changed to softAuthProcedure which:
- Validates API keys from x-api-key header
- Sets ctx.user for authenticated requests
- Allows owners to access their private tiles via MCP

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add type assertions for Direction enum comparisons to fix
  no-unsafe-enum-comparison errors in _item-context.service.ts
- Remove unused imports (_throwInternalError, _throwUnauthorized)
  from user.ts

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…stency

- Update hexrun command to pass hexframe_mcp parameter to sync agent
- Sync agent tile now accepts hexframe_mcp (default: "hexframe") to use
  consistent MCP server across all operations
- Ensures debughexframe usage propagates correctly to sync agent

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The MCP tool definition was missing the deleteHexplan parameter that
was already supported by the tRPC endpoint. This prevented /hexrun
from properly passing deleteHexplan:true to clear hexplans before
sync agent execution.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add <hexrun-intro> section explaining iterative execution model
- Agents now understand tiles may execute multiple times across hexruns
- Add "Feedback from last HEXRUN:" pattern for incorporating user feedback
- Add intro to ancestor-context explaining task hierarchy context
- Document feedback loop workflow in hexrun.md command

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add sessionId to CreateAgenticServiceOptions interface
- Create createAgenticServiceAsync for session-based sandbox reuse
- Export sandboxSessionManager singleton from sandbox-session module
- Pass external sandbox to ClaudeAgentSDKSandboxRepository when sessionId provided
- Update EventBus type to EventBusService interface for better abstraction
- Add comprehensive tests for factory session integration

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Dead code analysis identified errors.ts as unused. The error classes
(AgenticError, LLMProviderError, etc.) were defined but never imported
anywhere in the codebase.

Note: JobResult flagged as dead is a false positive - it's used as
a type import in useJobPolling.ts which the analyzer doesn't detect.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
TDD tests defining expected behavior for sandboxSessionId derivation:
- Derive from session.id for web UI sessions
- Derive from userId + "-api-key" suffix for API key auth
- Return undefined for anonymous users (ephemeral sandbox)
- Ensure deterministic session ID across requests

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add deriveSandboxSessionId() helper function to derive persistent sandbox
session identifiers from authentication context. Update agenticServiceMiddleware
to use createAgenticServiceAsync with sessionId for sandbox reuse.

Derivation rules:
- Web UI sessions: use session.id
- API key auth: use userId + "-api-key" suffix
- Anonymous users: undefined (ephemeral sandbox)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…iance

- Split rate-limit.ts (20 functions) into separate modules:
  - _types.ts: Type definitions
  - _store.ts: Rate limit storage implementations
  - _utils.ts: Helper functions (with shared key generator)
  - _core.ts: Core rate limiting logic
  - _middleware.ts: tRPC middleware factories
  - _presets.ts: Pre-configured rate limit presets
  - index.ts: Public re-exports

- Split _error-helpers.ts (10 functions) into:
  - _require-helpers.ts: Authentication/authorization assertions
  - _throw-helpers.ts: Error throwing functions
  - _domain-error-mapping.ts: Domain error to tRPC error mapping
  - index.ts: Public re-exports

- Updated trpc.ts to import createAgenticServiceAsync from domain index

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added new responsibility for deriving sandbox session IDs
- Documented deriveSandboxSessionId function and derivation rules
- Added table showing session ID sources for each auth method
- Updated mental model to include session identity aspect
- Cleaned up non-responsibilities section
Add Expiration Handling section to README.md documenting:
- isSessionValid() for health checks
- extendSession() for explicit timeout extension
- getOrCreateSession() automatic recreation behavior

Update mental model to include transparent room rebooking analogy.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add documentation for the new cleanup methods added for user logout:
- cleanupUserSession(): fire-and-forget cleanup for logout/disconnect
- getActiveSessionCount(): utility for monitoring active sessions
- hasActiveSession(): synchronous cache presence check
- Document integration with auth logout router

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…anup

Complete implementation of persistent Vercel sandbox sessions:

- Add SandboxSessionManager service with TTL-based session caching
- Add session reuse to ClaudeAgentSDKSandboxRepository (ownership pattern)
- Create async factory function for session-based sandbox creation
- Integrate session ID derivation in API context middleware
- Add transparent sandbox expiration handling with auto-recreation
- Implement fire-and-forget cleanup on user logout
- Add 35 comprehensive tests covering all functionality

Work units completed:
1. Create Sandbox Session Manager Service
2. Refactor ClaudeAgentSDKSandboxRepository
3. Update Agentic Factory
4. Add Session ID to API Context
5. Handle Sandbox Expiration
6. Add Cleanup on Logout

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
hexframe Ready Ready Preview, Comment Dec 19, 2025 0:05am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature-claude-sessions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

The SandboxSessionManager was creating bare sandboxes without installing
the @anthropic-ai/claude-agent-sdk package. When ClaudeAgentSDKSandboxRepository
received an externally-provided sandbox, it skipped SDK installation assuming
the sandbox was already ready, causing "Cannot find module" errors.

Changes:
- Add npm install for @anthropic-ai/claude-agent-sdk in _createNewSandbox
- Configure sandbox with runtime: node22, timeout: 5m, vcpus: 2
- Add logging for sandbox creation and SDK installation
- Add tests verifying SDK installation and sandbox configuration

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add console.log statements to critical sandbox session paths:
- getOrCreateSession: Log session lookup, reuse, and creation
- _createNewSandbox: Log SDK installation with exit code and output
- agenticServiceMiddleware: Log session ID derivation

Also added error handling for SDK installation failure with clear error
messages. These logs will appear in Vercel's function logs to help
diagnose sandbox reuse issues.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sandbox sessions are now persisted to Redis (Upstash) to survive serverless
cold starts. Previously, sessions were stored in-memory and lost when the
serverless function restarted, causing a new sandbox for every request.

Changes:
- Add @upstash/redis dependency
- Add UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN env vars
- Create RedisSessionStore and MemorySessionStore implementations
- Update SandboxSessionManager to use ISessionStore interface
- Auto-detect Redis configuration and fallback to memory store
- Add comprehensive logging for debugging session reuse
- Update tests and README with setup instructions

Setup:
1. Create free Redis at https://console.upstash.com
2. Add UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN to .env.local
3. Same credentials work locally and on Vercel

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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