Conversation
…e operations to nonblocking to decrease loading states duration
…for testing/local development
…or database user migration + test files for db connection test
Brings all missing optimizations from feat/stripe branch: - Non-blocking chat API with fire-and-forget pattern (fixes 6-10s delay) - AI Gateway integration for proper model routing - Atomic message sequencing with addMessageWithSequence - Credit deduction race condition fixes with row-level locking - Local Docker PostgreSQL setup for development - Database driver switching (pg for local, neon-serverless for production) - Improved chat interface with error handling and timeout safety - Logout functionality and session management - Seed scripts for local development - .env.example template 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…thentication local database sync issues
…ing callback route file
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Free review on us!CodeRabbit is offering free reviews until Wed Oct 08 2025 to showcase some of the refinements we've made. Comment |
This was referenced Dec 9, 2025
This was referenced Dec 18, 2025
Closed
Merged
Merged
This was referenced Jan 9, 2026
Merged
This was referenced Jan 29, 2026
This was referenced Feb 5, 2026
This was referenced Feb 5, 2026
This was referenced Feb 6, 2026
8 tasks
13 tasks
8 tasks
0xSolace
added a commit
that referenced
this pull request
Mar 9, 2026
Critical bugs fixed: - #1: resolveContainer() now hydrates from DB after restart instead of falling back to first node. Added findBySandboxId() and listByNodeId() repository methods for DB-backed container resolution. - #2: create() now uses DockerNodeManager.getAvailableNode() for least-loaded placement instead of random env-var selection. Increments allocated_count on create, decrements on stop. Falls back to env var only when DB has no nodes registered. - #3: Port allocation now queries DB for ports already assigned on the target node. allocatePort() takes an exclusion set and retries until it finds a free port. Security fixes: - #4: runCommand() now shell-escapes cmd and each arg individually via shellQuote() before passing to SSH exec. Container names also quoted in docker exec/stop/rm commands. - #5: Added validateAgentId() check (UUID-safe chars only, max 128) called before any shell interpolation of agentId. getVolumePath() validates before constructing path. Functional fixes: - #6: checkHealth() now polls with retry loop (3s interval, 60s total timeout) matching Vercel provider behavior, instead of single-shot 8s request. - #7: getContainerName() now uses full agentId instead of truncated first-8-chars to eliminate collision risk. Code quality fixes: - #8: Exported DockerSandboxMetadata interface for strongly-typed metadata. milaidy-sandbox.ts imports and narrows with it instead of Record<string, unknown> + as casts. - #9: Fixed step numbering in create() comments (was 8→10, now 8→9→10). - #10: SSH pool key changed from hostname-only to hostname:port to prevent collisions when nodes share hostname with different ports. - #11: parseDockerNodes() result now cached at module level, only re-parsed when MILAIDY_DOCKER_NODES env var changes. - #12: Moved DOCKER_HEADSCALE_PLAN.md and DOCKER_PROVISIONING_SUMMARY.md from repo root to docs/ directory. No new type errors (tsc --noEmit passes with only 2 pre-existing errors).
15 tasks
0xSolace
added a commit
that referenced
this pull request
Mar 9, 2026
Fixes all 11 findings from the automated review: Critical: - (#1) Fix migration number references: 0034 → 0046 in schema comments and docs - (#2) Port race TOCTOU: add partial UNIQUE index on (node_id, bridge_port) for active sandboxes. allocatePort() already retries; DB constraint is the safety net for concurrent provisioning - (#3) SSH pool serverless compat: add idle timeout (5min) eviction on getClient(), track lastActivityMs on exec() Security: - (#4) Remove `as any` cast on statusFilter — validate against known status set, return 400 for invalid values, cast to MiladySandboxStatus type - (#5) Add SENSITIVE_KEYS set to redact TS_AUTHKEY, DATABASE_URL, etc. from any logged docker run commands - (#6) Document MILADY_DOCKER_NODES fallback as seed-only path with no load balancing — production should use Admin API node registration Code quality: - (#7) Remove ssh! non-null assertions in health check route — use definite assignment after early-return guard - (#8) Migration already uses IF NOT EXISTS on all statements ✓ - (#9) Unit tests noted as follow-up work (not blocking) Nits: - (#10) Add logger.warn fallback when Vercel sandbox has neither shutdown() nor close() method - (#11) PR draft status — will mark ready after fixes are confirmed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive analytics API for the application, adding new endpoints, configuration options, and data export capabilities. The changes provide flexible breakdowns, predictive analytics, and enhanced export utilities, along with robust authentication and configuration management. Below are the most important changes grouped by theme:
Analytics API Endpoints
app/api/analyticsdirectory. [1] [2] [3]Export & Data Utilities
app/api/analytics/export/route.ts.Configuration Management
app/api/analytics/config/route.ts.Documentation & Developer Experience
ANALYTICS_QUICK_REFERENCE.mdproviding a summary of endpoints, usage examples, file structure, common use cases, configuration options, troubleshooting, and integration tips for the analytics API..env.exampleandCLAUDE.mdto include local development environment variables and commands for automated database setup and management. [1] [2]