-
-
Notifications
You must be signed in to change notification settings - Fork 4
Update agent #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update agent #63
Conversation
WalkthroughThis PR consolidates documentation cleanup with backend API restructuring for the agent. It removes planning and architecture documents, updates handlers and services with structured request/response types, adds concurrent resource creation with a second file share (home directory) support in Azure, and introduces enhanced error handling patterns. Changes
Sequence Diagram(s)sequenceDiagram
actor Client
participant Handler
participant Service
participant Azure as Azure API
Client->>Handler: StartEnvironment (Request)
Handler->>Handler: Validate Request
alt Validation Fails
Handler-->>Client: 400 Bad Request (ErrorResponse)
else Validation Passes
Handler->>Service: StartEnvironment(req)
Service->>Service: Verify Workspace Volume
Service->>Service: Verify Home Volume
alt Volumes Missing
Service-->>Handler: Error
Handler-->>Client: 404 Not Found (ErrorResponse)
else Volumes Exist
Service->>Azure: Delete Container (if exists)
Service->>Azure: Create New Container (reuse volumes)
Service-->>Handler: *Environment + message
Handler-->>Client: 200 OK (SuccessResponse)
end
end
sequenceDiagram
actor Client
participant Handler
participant Service
participant Azure as Azure Storage/ACI
Client->>Handler: CreateEnvironment (Request)
Handler->>Service: CreateEnvironment()
par Concurrent Operations
Service->>Azure: Create Workspace File Share (fs-{id})
Service->>Azure: Create Home File Share (fs-{id}-home)
Service->>Azure: Create Container Group (mount both)
and
Note over Service: Coordinate via channels<br/>Track completion/errors
end
alt Any Operation Fails
Service->>Azure: Cleanup (delete created resources)
Service-->>Handler: Error + cleanup details
Handler-->>Client: 500 Internal Server Error
else All Succeed
Service-->>Handler: *Environment (with FQDN)
Handler-->>Client: 201 Created (SuccessResponse)
end
Estimated code review effortπ― 4 (Complex) | β±οΈ ~45 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touchesβ Failed checks (2 warnings, 1 inconclusive)
β¨ Finishing touches
π§ͺ Generate unit tests (beta)
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. Comment |
1877633 to
cb2d750
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and canβt be posted inline due to platform limitations.
β οΈ Outside diff range comments (2)
apps/agent/internal/models/environment.go (1)
28-34: Avoid returning CodeServerPassword broadly; mark as omitempty or move to one-time response.CodeServerPassword lives in ConnectionURLs and will serialize even when empty. Consider treating it as a one-time secret returned only on create/start, not embedded in the generic model. At minimum: add omitempty.
type ConnectionURLs struct { @@ - CodeServerPassword string `json:"codeServerPassword"` // Generated password for VS Code auth + CodeServerPassword string `json:"codeServerPassword,omitempty"` // One-time reveal on create/start }apps/agent/internal/azure/client.go (1)
210-215: Missing ports 2222 and 9000 break SSH and supervisor.Only 8080 is exposed in container and public IP. Add 2222 and 9000 to both sections to match the documented services and handlers.
- Ports: []*armcontainerinstance.ContainerPort{ - {Port: to.Ptr(int32(8080)), Protocol: to.Ptr(armcontainerinstance.ContainerNetworkProtocolTCP)}, - }, + Ports: []*armcontainerinstance.ContainerPort{ + {Port: to.Ptr(int32(8080)), Protocol: to.Ptr(armcontainerinstance.ContainerNetworkProtocolTCP)}, + {Port: to.Ptr(int32(2222)), Protocol: to.Ptr(armcontainerinstance.ContainerNetworkProtocolTCP)}, + {Port: to.Ptr(int32(9000)), Protocol: to.Ptr(armcontainerinstance.ContainerNetworkProtocolTCP)}, + }, @@ - Ports: []*armcontainerinstance.Port{ - {Port: to.Ptr(int32(8080)), Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP)}, - }, + Ports: []*armcontainerinstance.Port{ + {Port: to.Ptr(int32(8080)), Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP)}, + {Port: to.Ptr(int32(2222)), Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP)}, + {Port: to.Ptr(int32(9000)), Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP)}, + },Also applies to: 219-227
π§Ή Nitpick comments (21)
docker/CONTAINER_CAPABILITIES.md (1)
151-165: Backup/restore ownership inconsistent with code.This section states βControl Plane handles all backup/restore,β but the agent still injects BACKUP_* env vars into the container (apps/agent/internal/azure/client.go). Align the docs and code: remove those envs or document their current use.
Also applies to: 184-192
apps/agent/internal/models/environment.go (3)
53-58: Model the new home file share on the Environment.Azure now mounts a second share (/home/dev8). Expose it to keep API and infra aligned.
type Environment struct { @@ - AzureFileShare string `json:"azureFileShare"` // e.g., "fs-clxxx-yyyy-zzzz" + AzureFileShare string `json:"azureFileShare"` // workspace share (code) + AzureHomeFileShare string `json:"azureHomeFileShare,omitempty"` // home share (extensions/settings)
215-219: Strengthen WorkspaceID validation.len < 10 is weak; use a regex or specific validator for your chosen ID format (UUID/cuid). This prevents accidental acceptance of malformed IDs.
148-152: Use EnvironmentStatus type for UpdateEnvironmentRequest.Status.Tie the field to the enum type to prevent invalid values at compile time.
type UpdateEnvironmentRequest struct { Name string `json:"name,omitempty"` - Status string `json:"status,omitempty"` + Status EnvironmentStatus `json:"status,omitempty"` }apps/agent/main.go (3)
38-45: Donβt hard-code the ACR image path; reuse the same resolver used by services.Logs print β/dev8-workspace:latestβ regardless of cfg.ContainerImage. Use a shared helper (e.g., services image resolver) so logs match the actual image used for ACI.
95-97: Version should be sourced from config/build-time, not hard-coded.Expose a version var via -ldflags or config and render it here to avoid drift.
85-86: Consider pathing DELETE as /environments/{id}.You currently accept workspaceId in body. For clearer REST semantics and cacheability, consider moving the id to the path. Not blocking.
apps/agent/internal/azure/client.go (2)
184-192: Remove or gate BACKUP_ envs to match βcontrol plane handles backup.β*If backups are now external, drop these envs or guard behind a config flag to prevent confusion.
90-121: Home share mount is nested under workspace-share guard.If you ever support home-only mounts, the current guard will skip it. Consider independent checks so each share can be mounted when present. Not blocking if you always create both.
apps/agent/internal/handlers/environment.go (4)
35-37: Avoid defaulting to a synthetic user.Falling back to "default-user" can mask auth issues and misattribute resources. Reject missing userId (401) or derive from auth context.
45-48: Remove duplicate βmessageβ inside data; it already exists at top-level.Keep message only in SuccessResponse.Message to avoid redundancy and schema drift.
respondWithSuccess(w, http.StatusCreated, "Workspace created successfully", map[string]interface{}{ - "environment": env, - "message": "Your development environment is ready to use", + "environment": env, }) @@ respondWithSuccess(w, http.StatusOK, "Workspace started successfully", map[string]interface{}{ - "environment": env, - "message": "Your workspace is now running with existing data", + "environment": env, })Also applies to: 86-89
191-199: Preserve domain error codes in responses.respondWithError always emits Code as ERR_, losing AppError.Code (e.g., INVALID_REQUEST, CONFLICT). Map AppError.Code into the payload so clients can branch reliably.
I can draft a small respondWithAppError helper and wire handleServiceError to use itβwant a patch?
Also applies to: 201-218
123-124: Consistent casing in error labels.Use a consistent style for error titles (βInvalid Request Bodyβ vs βInvalid request bodyβ). Minor polish.
apps/agent/API_DOCUMENTATION.md (3)
565-565: Wrap URL in angle brackets for proper Markdown rendering.Bare URLs should be enclosed in angle brackets to ensure they render correctly as clickable links in all Markdown processors.
Apply this change:
-**Public URL:** https://www.postman.com/vpatil5212/dev8-agent-api +**Public URL:** <https://www.postman.com/vpatil5212/dev8-agent-api>
674-674: Wrap email in angle brackets for proper Markdown rendering.Apply this change:
-- **Email**: support@dev8.dev +- **Email**: <support@dev8.dev>
50-60: Add language specifiers to code blocks for better syntax highlighting.Several code blocks lack language identifiers. While not critical, adding them improves readability and enables proper syntax highlighting.
Examples:
- Lines 50-60: Add
textfor ASCII diagrams- Lines 287-297, 350-355, 389-392: Add
logortextfor log output- Line 177-180: Add
textfor base URL listingsExample fix for log blocks:
-``` +```log 2025/10/27 14:30:00 π Creating workspace...Also applies to: 287-297, 350-355
apps/agent/internal/services/environment.go (5)
186-187: Replace fixed sleep with polling for FQDN availability.The 3-second sleep assumes the FQDN will be available, but Azure's API may take longer. Consider implementing a polling mechanism with exponential backoff and a reasonable timeout.
Example pattern:
// Poll for FQDN with timeout ctx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() ticker := time.NewTicker(2 * time.Second) defer ticker.Stop() for { select { case <-ctx.Done(): log.Printf("Warning: FQDN not available after timeout") break case <-ticker.C: containerDetails, err := s.azureClient.GetContainerGroup(ctx, req.CloudRegion, resourceGroup, containerGroupName) if err == nil && containerDetails != nil && containerDetails.Properties != nil && containerDetails.Properties.IPAddress != nil && containerDetails.Properties.IPAddress.Fqdn != nil { fqdn = *containerDetails.Properties.IPAddress.Fqdn goto FoundFQDN } } } FoundFQDN:
168-184: Log cleanup failures for better visibility.The cleanup logic silently ignores errors using
_, which could hide orphaned resources. Consider logging cleanup failures to aid troubleshooting.if workspaceResult.err != nil { - _ = storageClient.DeleteFileShare(ctx, homeFileShareName) - _ = s.azureClient.DeleteContainerGroup(ctx, req.CloudRegion, resourceGroup, containerGroupName) + if err := storageClient.DeleteFileShare(ctx, homeFileShareName); err != nil { + log.Printf("Warning: cleanup failed for home share %s: %v", homeFileShareName, err) + } + if err := s.azureClient.DeleteContainerGroup(ctx, req.CloudRegion, resourceGroup, containerGroupName); err != nil { + log.Printf("Warning: cleanup failed for container group %s: %v", containerGroupName, err) + } return nil, fmt.Errorf("failed to create workspace file share: %w", workspaceResult.err) }
330-331: Same FQDN polling issue as in CreateEnvironment.This has the same limitation as line 187 in CreateEnvironment. Consider extracting the polling logic into a shared helper method used by both CreateEnvironment and StartEnvironment.
Example helper:
func (s *EnvironmentService) waitForFQDN(ctx context.Context, region, resourceGroup, containerGroupName string, timeout time.Duration) (string, error) { ctx, cancel := context.WithTimeout(ctx, timeout) defer cancel() ticker := time.NewTicker(2 * time.Second) defer ticker.Stop() for { select { case <-ctx.Done(): return "", fmt.Errorf("FQDN not available after %v", timeout) case <-ticker.C: container, err := s.azureClient.GetContainerGroup(ctx, region, resourceGroup, containerGroupName) if err == nil && container != nil && container.Properties != nil && container.Properties.IPAddress != nil && container.Properties.IPAddress.Fqdn != nil { return *container.Properties.IPAddress.Fqdn, nil } } } }
128-152: Extract duplicated container spec creation into a helper method.The container spec creation logic is duplicated between CreateEnvironment and StartEnvironment. Consider extracting this into a shared helper method to improve maintainability.
func (s *EnvironmentService) buildContainerSpec( workspaceID string, req interface{}, // Use type switch or interface with common methods regionConfig *config.RegionConfig, fileShareName, homeFileShareName, dnsLabel string, ) azure.ContainerGroupSpec { // Extract common fields based on request type // Return populated ContainerGroupSpec }Then call it from both methods:
containerSpec := s.buildContainerSpec(workspaceID, req, regionConfig, fileShareName, homeFileShareName, dnsLabel)Also applies to: 294-324
494-504: Consider using or removing the unusedbaseImageparameter.The
baseImageparameter is explicitly ignored (line 502), which may confuse callers. Consider either:
- Implementing base image selection logic now
- Removing the parameter until it's needed
- Adding a clear TODO for future implementation
If keeping for future use, enhance the comment:
- // Fallback to Docker Hub or configured image - // baseImage parameter is ignored - can be used for future customization + // TODO: Implement base image selection (node, python, go, etc.) + // For now, baseImage parameter is reserved for future customization return s.config.ContainerImage
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (24)
.github/workflows/README.md(11 hunks)DOCKER_IMPLEMENTATION_COMPLETE.md(0 hunks)ISSUE_PRIORITIES.md(0 hunks)MVP_DOCKER_PLAN.md(0 hunks)QUICK_REFERENCE_AI_TOOLS.md(7 hunks)QUICK_START.md(2 hunks)VSCODE_SERVER_AI_CLI_INTEGRATION_PLAN.md(0 hunks)VSCODE_SERVER_COPILOT_RESEARCH.md(0 hunks)WORKSPACE_MANAGER_PLAN.md(0 hunks)apps/agent/API_DOCUMENTATION.md(1 hunks)apps/agent/README.md(2 hunks)apps/agent/internal/azure/client.go(2 hunks)apps/agent/internal/handlers/environment.go(8 hunks)apps/agent/internal/models/environment.go(4 hunks)apps/agent/internal/services/environment.go(3 hunks)apps/agent/main.go(1 hunks)apps/supervisor/API_DOCUMENTATION.md(23 hunks)docker/ACR_SETUP_GUIDE.md(0 hunks)docker/ARCHITECTURE.md(10 hunks)docker/CHANGELOG.md(0 hunks)docker/CONTAINER_CAPABILITIES.md(9 hunks)docker/README.md(14 hunks)packages/environment-types/src/types.ts(1 hunks)test-schema.js(0 hunks)
π€ Files with no reviewable changes (9)
- VSCODE_SERVER_AI_CLI_INTEGRATION_PLAN.md
- docker/CHANGELOG.md
- MVP_DOCKER_PLAN.md
- docker/ACR_SETUP_GUIDE.md
- WORKSPACE_MANAGER_PLAN.md
- DOCKER_IMPLEMENTATION_COMPLETE.md
- ISSUE_PRIORITIES.md
- test-schema.js
- VSCODE_SERVER_COPILOT_RESEARCH.md
π§° Additional context used
𧬠Code graph analysis (2)
apps/agent/internal/handlers/environment.go (1)
apps/agent/internal/models/environment.go (7)
ErrInvalidRequest(315-317)StartEnvironmentRequest(95-116)StopEnvironmentRequest(119-122)DeleteEnvironmentRequest(142-146)SuccessResponse(298-302)ErrorResponse(290-295)AppError(305-308)
apps/agent/internal/services/environment.go (2)
apps/agent/internal/azure/client.go (1)
ContainerGroupSpec(326-354)apps/agent/internal/models/environment.go (7)
StartEnvironmentRequest(95-116)Environment(37-66)ErrNotFound(319-321)ErrInternalServer(323-325)ErrInvalidRequest(315-317)StatusRunning(11-11)ConnectionURLs(28-34)
πͺ markdownlint-cli2 (0.18.1)
docker/README.md
389-389: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
apps/agent/API_DOCUMENTATION.md
11-11: Link fragments should be valid
(MD051, link-fragments)
12-12: Link fragments should be valid
(MD051, link-fragments)
13-13: Link fragments should be valid
(MD051, link-fragments)
14-14: Link fragments should be valid
(MD051, link-fragments)
15-15: Link fragments should be valid
(MD051, link-fragments)
16-16: Link fragments should be valid
(MD051, link-fragments)
17-17: Link fragments should be valid
(MD051, link-fragments)
18-18: Link fragments should be valid
(MD051, link-fragments)
19-19: Link fragments should be valid
(MD051, link-fragments)
50-50: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
64-64: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
100-100: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
137-137: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
158-158: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
162-162: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
167-167: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
177-177: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
287-287: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
350-350: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
389-389: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
547-547: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
565-565: Bare URL used
(MD034, no-bare-urls)
569-569: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
674-674: Bare URL used
(MD034, no-bare-urls)
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-base
- GitHub Check: Build and Push
π Additional comments (10)
apps/agent/README.md (1)
102-102: LGTM! Formatting improvements for readability.The added blank lines improve document structure and readability without affecting any functional content.
Also applies to: 116-116
docker/ARCHITECTURE.md (1)
72-75: LGTM! Documentation structure improvements.The formatting changes enhance readability through better bullet point structure and consistent markdown formatting.
Also applies to: 86-88, 101-105, 139-155
packages/environment-types/src/types.ts (1)
356-358: LGTM! Consistent formatting.The multi-line function signature improves consistency with other type guard functions in this file.
docker/README.md (1)
1-550: LGTM! Documentation formatting improvements.The extensive markdown formatting changes enhance document readability and structure. Commands, workflows, and technical content remain accurate.
QUICK_REFERENCE_AI_TOOLS.md (1)
24-26: LGTM! Enhanced documentation clarity.The formatting improvements, table alignment, and expanded examples make the quick reference more user-friendly.
Also applies to: 45-45, 64-68, 85-85, 108-111, 117-124, 130-135, 154-154
QUICK_START.md (1)
30-32: LGTM! Helpful configuration guidance added.The new configuration examples provide clear guidance on required and optional settings, improving the user onboarding experience.
Also applies to: 36-46, 76-76
.github/workflows/README.md (1)
35-38: LGTM! CI/CD documentation improvements.The formatting enhancements, consistent quote usage, and improved table structure make the workflow documentation clearer without changing any pipeline behavior.
Also applies to: 41-46, 49-50, 53-61, 68-70, 84-85, 149-155, 255-257, 260-261, 272-275, 283-284, 404-408, 411-415, 422-427, 434-437, 454-457
apps/supervisor/API_DOCUMENTATION.md (1)
40-48: LGTM! Comprehensive API documentation improvements.The expanded examples, improved formatting, and clearer field descriptions enhance the documentation quality without altering any API behavior or contracts.
Also applies to: 50-56, 58-60, 62-65, 74-84, 86-94, 96-98, 100-103, 114-117, 120-122, 124-128, 137-141, 144-148, 151-158, 162-171, 174-186, 197-202, 204-208, 219-221, 224-225, 228-232, 235-239, 242-247, 250-252, 272-276, 293-296, 390-396, 399-405, 461-468, 473-481, 484-492, 505-513, 524-534, 585-605
docker/CONTAINER_CAPABILITIES.md (2)
186-193: Ports table and ACI config are out of sync.Docs list 8080/2222/9000 as exposed, but the Azure ACI spec currently opens only 8080. Either update this table or expose the missing ports in apps/agent/internal/azure/client.go to avoid broken SSH (2222) and supervisor (9000) access.
Also applies to: 210-219
64-69: GITHUB_TOKEN marked βRequiredβ but treated as optional in code.Docs declare GITHUB_TOKEN as required, yet the agent only sets it if provided. Update the docs to βOptionalβ or enforce it in request validation.
Also applies to: 70-83
| // Validate validates the start environment request | ||
| func (r *StartEnvironmentRequest) Validate() error { | ||
| if r.WorkspaceID == "" { | ||
| return ErrInvalidRequest("workspaceId is required") | ||
| } | ||
| if r.CloudRegion == "" { | ||
| return ErrInvalidRequest("cloudRegion is required") | ||
| } | ||
| if r.UserID == "" { | ||
| return ErrInvalidRequest("userId is required") | ||
| } | ||
| if r.Name == "" { | ||
| return ErrInvalidRequest("name is required") | ||
| } | ||
| if r.CPUCores < 1 || r.CPUCores > 4 { | ||
| return ErrInvalidRequest("cpuCores must be between 1 and 4") | ||
| } | ||
| if r.MemoryGB < 2 || r.MemoryGB > 16 { | ||
| return ErrInvalidRequest("memoryGB must be between 2 and 16") | ||
| } | ||
| if r.BaseImage == "" { | ||
| r.BaseImage = "node" | ||
| } | ||
| return nil | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add StorageGB validation to StartEnvironmentRequest.Validate.
Start requires StorageGB (for share sizing) but doesnβt validate it, unlike Create. Add the same bounds to prevent invalid starts.
func (r *StartEnvironmentRequest) Validate() error {
@@
if r.MemoryGB < 2 || r.MemoryGB > 16 {
return ErrInvalidRequest("memoryGB must be between 2 and 16")
}
+ if r.StorageGB < 10 || r.StorageGB > 100 {
+ return ErrInvalidRequest("storageGB must be between 10 and 100")
+ }
if r.BaseImage == "" {
r.BaseImage = "node"
}
return nil
}π€ Prompt for AI Agents
In apps/agent/internal/models/environment.go around lines 241-265,
StartEnvironmentRequest.Validate currently omits validation for StorageGB; add a
check that enforces the same min/max bounds used by
CreateEnvironmentRequest.Validate (i.e. ensure StorageGB is present and within
the same allowed range), and return ErrInvalidRequest("storageGB must be between
<min> and <max>") when out of range; implement the check similar to the
CPU/Memory checks (if r.StorageGB < min || r.StorageGB > max { return
ErrInvalidRequest("storageGB must be between <min> and <max>") }).
| // Goroutine 3: Create ACI container (starts IMMEDIATELY, doesn't wait for shares) | ||
| go func() { | ||
| // Small delay to let shares start first (Azure may need them) | ||
| time.Sleep(500 * time.Millisecond) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace arbitrary sleep with proper synchronization.
The 500ms sleep attempts to ensure file shares start before container creation, but this is unreliable. If Azure actually requires the shares to exist before container provisioning, the goroutine should wait for the share creation results before proceeding.
Consider this approach:
- // Goroutine 3: Create ACI container (starts IMMEDIATELY, doesn't wait for shares)
+ // Goroutine 3: Create ACI container (waits for shares if needed)
go func() {
- // Small delay to let shares start first (Azure may need them)
- time.Sleep(500 * time.Millisecond)
+ // Wait for both shares to be created first if Azure requires it
+ workspaceShareResult := <-workspaceChan
+ homeShareResult := <-homeChan
+
+ if workspaceShareResult.err != nil || homeShareResult.err != nil {
+ aciChan <- operationResult{name: "aci-container", err: fmt.Errorf("share creation failed, skipping container")}
+ return
+ }
containerSpec := azure.ContainerGroupSpec{Note: If shares don't need to exist before container creation, remove the sleep and comment entirely.
π€ Prompt for AI Agents
In apps/agent/internal/services/environment.go around lines 123 to 127, remove
the arbitrary time.Sleep(500*time.Millisecond) and replace it with explicit
synchronization: have the container-creation goroutine wait on a channel or
sync.WaitGroup (or a context-aware signal) that the share-creation routine
closes/signals when shares are successfully created (or failed), or poll the
Azure share existence with a short backoff until ready before proceeding;
alternatively, if shares truly aren't required before container creation, remove
the sleep and add a clarifying comment. Ensure errors from share creation are
propagated so the container step can fail fast instead of proceeding blindly.
|
|
||
| ```bash | ||
| CODE_SERVER_AUTH=password | ||
| CODE_SERVER_PASSWORD=your_secure_password | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language identifier to code fence.
The code block is missing a language identifier, which triggers a markdownlint warning. Please add bash to the opening fence for proper syntax highlighting.
Apply this diff:
-```bash
+```bash
CODE_SERVER_AUTH=password
CODE_SERVER_PASSWORD=your_secure_password
Wait, looking at this again - the line numbers and content don't match. Let me check the actual line 389.
<details>
<summary>π§° Tools</summary>
<details>
<summary>πͺ markdownlint-cli2 (0.18.1)</summary>
389-389: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
</details>
</details>
<details>
<summary>π€ Prompt for AI Agents</summary>
In docker/README.md around lines 386 to 390, the fenced code block is missing
the language identifier; update the opening fence from tobash so the
block becomes a bash-highlighted code fence (i.e., replace the opening fence
line with ```bash and leave the content and closing fence unchanged).
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
π Pull Request
π Description
Brief description of what this PR does.
π― Type of Change
π Related Issue
Fixes #(issue number)
π§ͺ Testing
πΈ Screenshots/Videos
If applicable, add screenshots or videos demonstrating the changes.
π Checklist
π Environment Tested
π Additional Notes
Any additional information that reviewers should know.
Summary by CodeRabbit
Release Notes
New Features
Configuration
GITHUB_TOKENandCODE_SERVER_AUTHoptions for enhanced security and authentication flexibility.Documentation