-
Notifications
You must be signed in to change notification settings - Fork 525
fix: Quick wins batch - #428, #433, #395, #396 #445
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
fix: Quick wins batch - #428, #433, #395, #396 #445
Conversation
…er-Org#395, AutoMaker-Org#396 - AutoMaker-Org#428: Listen on 0.0.0.0 to support both IPv4 and IPv6 - AutoMaker-Org#433: Use theme-aware colors in agent output modal for light mode - AutoMaker-Org#395: Use DATA_DIR for deauth-claude marker file in Docker - AutoMaker-Org#396: Capitalize ideation category mapping to prevent duplicates Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughServer listen now binds to a configurable host (env HOST); deauth handler switched to async fs/promises and writes a Changes
Sequence Diagram(s)(omitted — changes are primarily configuration, async IO, minor UI and mapping updates; no new multi-component control flow requiring a diagram) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
Summary of ChangesHello @aleslednej, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request consolidates several 'quick win' fixes that enhance the application's robustness, user experience, and deployment flexibility. The changes include improving network compatibility for the server, ensuring correct file system permissions in containerized environments, refining UI element styling for theme consistency, and standardizing data categorization logic. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a batch of fixes and improvements across the server and UI. The server now listens on 0.0.0.0 for better container compatibility, and a Docker permission issue is resolved by using the DATA_DIR environment variable for a marker file. The ideation category mapping has been updated for consistency, and the agent output modal in the UI now uses theme-aware colors for better light mode support.
My review focuses on ensuring these changes are implemented correctly and follow best practices. I've found one area for improvement in the deauth-claude.ts route handler where synchronous file system calls can be replaced with asynchronous ones to avoid blocking the event loop.
| if (!fs.existsSync(DATA_DIR)) { | ||
| fs.mkdirSync(DATA_DIR, { recursive: true }); | ||
| } |
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.
In an async function, it's best to use asynchronous file system operations to avoid blocking the event loop. You can replace fs.existsSync and fs.mkdirSync with a single call to fs.promises.mkdir. The recursive: true option ensures that the directory is created if it doesn't exist, and it doesn't throw an error if it already exists, so the existence check is not needed.
await fs.promises.mkdir(DATA_DIR, { recursive: true });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: 1
🤖 Fix all issues with AI agents
In @apps/server/src/services/ideation-service.ts:
- Around line 1684-1698: The mapSuggestionCategoryToFeatureCategory function
currently converts IdeaCategory values to capitalized strings but may miss
future categories; ensure the mapping object in
mapSuggestionCategoryToFeatureCategory exactly covers every variant of the
IdeaCategory union, keep its type as Record<IdeaCategory, string>, add any
missing category keys (using their exact IdeaCategory symbol names like feature,
'ux-ui', dx, growth, technical, security, performance, accessibility,
analytics), and keep the fallback to 'Feature'; then confirm the add-suggestion
route uses mapSuggestionCategoryToFeatureCategory for all idea->feature
conversions so the mapping remains the single source of truth.
🧹 Nitpick comments (2)
apps/server/src/index.ts (1)
541-542: Comment is slightly misleading about IPv6 support.Binding to
0.0.0.0makes the server listen on all IPv4 interfaces, which fixes Docker connectivity issues. However, the comment states "support both IPv4 and IPv6" which is not accurate—0.0.0.0only binds to IPv4. For true dual-stack support, you would either:
- Omit the host parameter entirely (Node.js defaults to
::on dual-stack systems)- Explicitly bind to
::for IPv6 (which also accepts IPv4 on most systems)The fix itself is correct for the Docker issue (#428), but consider updating the comment to reflect that this specifically addresses IPv4 binding for container networking.
Suggested comment fix
- // Listen on 0.0.0.0 to support both IPv4 and IPv6 (fixes #428) + // Listen on 0.0.0.0 to bind all IPv4 interfaces for Docker compatibility (fixes #428) server.listen(port, '0.0.0.0', () => {apps/server/src/routes/setup/routes/deauth-claude.ts (1)
20-23: Minor: Consider simplifying the directory creation.The
existsSynccheck beforemkdirSynccreates a small TOCTOU (time-of-check-time-of-use) window. SincemkdirSyncwith{ recursive: true }is idempotent and won't throw if the directory already exists, you can simplify this:Suggested simplification
- // Ensure DATA_DIR exists (fixes #395 - Docker permission error) - if (!fs.existsSync(DATA_DIR)) { - fs.mkdirSync(DATA_DIR, { recursive: true }); - } + // Ensure DATA_DIR exists (fixes #395 - Docker permission error) + fs.mkdirSync(DATA_DIR, { recursive: true });
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apps/server/src/index.tsapps/server/src/routes/setup/routes/deauth-claude.tsapps/server/src/services/ideation-service.tsapps/server/tests/unit/services/ideation-service.test.tsapps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/server/src/services/ideation-service.tsapps/server/src/index.tsapps/server/tests/unit/services/ideation-service.test.tsapps/server/src/routes/setup/routes/deauth-claude.tsapps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx
apps/server/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
createEventEmitter()fromlib/events.tsfor all server operations to emit events that stream to frontend via WebSocket
Files:
apps/server/src/services/ideation-service.tsapps/server/src/index.tsapps/server/src/routes/setup/routes/deauth-claude.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/server/src/services/ideation-service.tsapps/server/src/index.tsapps/server/tests/unit/services/ideation-service.test.tsapps/server/src/routes/setup/routes/deauth-claude.tsapps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx
🧠 Learnings (2)
📚 Learning: 2025-12-28T05:07:48.147Z
Learnt from: CR
Repo: AutoMaker-Org/automaker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T05:07:48.147Z
Learning: Applies to apps/server/src/**/*.{ts,tsx} : Use `createEventEmitter()` from `lib/events.ts` for all server operations to emit events that stream to frontend via WebSocket
Applied to files:
apps/server/src/index.ts
📚 Learning: 2025-12-30T01:02:07.114Z
Learnt from: illia1f
Repo: AutoMaker-Org/automaker PR: 324
File: apps/ui/src/components/views/board-view/components/kanban-card/kanban-card.tsx:122-131
Timestamp: 2025-12-30T01:02:07.114Z
Learning: Tailwind CSS v4 uses postfix syntax for the important modifier: append ! at the end of the utility class (e.g., backdrop-blur-[0px]! or hover:bg-red-500!). The older v3 style used a prefix (!) at the start (e.g., !backdrop-blur-[0px]); prefer the postfix form for consistency across TSX files.
Applied to files:
apps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx
🧬 Code graph analysis (2)
apps/server/src/services/ideation-service.ts (1)
libs/types/src/ideation.ts (1)
IdeaCategory(9-18)
apps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx (1)
apps/ui/src/components/ui/markdown.tsx (1)
Markdown(16-51)
🔇 Additional comments (4)
apps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx (2)
404-406: Good use of theme-aware styling.The change from hardcoded
bg-zinc-950tobg-muted/50 dark:bg-zinc-950properly supports light mode while preserving the dark mode appearance. This aligns well with the theming approach used inmarkdown.tsxwhich uses similar semantic tokens liketext-foregroundandbg-muted.
412-427: Consistent theme-aware styling applied to content areas.The
text-foreground/80for raw output text is a good choice—it uses the semantic foreground color with reduced opacity for secondary text, which works well in both light and dark modes.apps/server/src/routes/setup/routes/deauth-claude.ts (1)
10-18: Good fix for Docker compatibility.Using
DATA_DIRenvironment variable with a sensible fallback is the correct approach for containerized deployments. This is consistent with howDATA_DIRis defined inapps/server/src/index.ts(line 73).apps/server/tests/unit/services/ideation-service.test.ts (1)
513-536: Test correctly updated to reflect capitalized category mapping.The test properly validates that ideas with
category: 'feature'are converted to features withcategory: 'Feature'. The assertion aligns with the updated mapping inideation-service.ts.
| mapSuggestionCategoryToFeatureCategory(category: IdeaCategory): string { | ||
| // Use capitalized categories to match existing conventions (fixes #396) | ||
| const mapping: Record<IdeaCategory, string> = { | ||
| feature: 'ui', | ||
| 'ux-ui': 'enhancement', | ||
| dx: 'chore', | ||
| growth: 'feature', | ||
| technical: 'refactor', | ||
| security: 'bug', | ||
| performance: 'enhancement', | ||
| accessibility: 'enhancement', | ||
| analytics: 'feature', | ||
| feature: 'Feature', | ||
| 'ux-ui': 'UI', | ||
| dx: 'DX', | ||
| growth: 'Growth', | ||
| technical: 'Technical', | ||
| security: 'Security', | ||
| performance: 'Performance', | ||
| accessibility: 'Accessibility', | ||
| analytics: 'Analytics', | ||
| }; | ||
| return mapping[category] || 'feature'; | ||
| return mapping[category] || 'Feature'; | ||
| } |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
cd /root
# Check the imports and structure of ideation-service.ts
echo "=== Checking ideation-service.ts imports ==="
head -50 apps/server/src/services/ideation-service.ts
echo ""
echo "=== Search for category usage patterns in codebase ==="
# Look for where categories are defined or used with capitalized names
rg -n --type=ts --type=tsx "Feature|DX|Growth|Technical|Security|Performance|Accessibility|Analytics" -g '!*.test.*' -g '!node_modules' --max-count=20 | head -40
echo ""
echo "=== Search for lowercase category patterns ==="
rg -n --type=ts --type=tsx "feature|growth|technical|security|performance|accessibility|analytics" -C1 -g '!*.test.*' -g '!node_modules' --max-count=25 | head -50Repository: AutoMaker-Org/automaker
Length of output: 1857
🏁 Script executed:
#!/bin/bash
# Check for Feature category field definitions
echo "=== Searching for Feature category usage ==="
rg -n "category" -t ts --max-count=30 | grep -i feature | head -20
echo ""
echo "=== Check for Feature type definition ==="
rg -n "type Feature" -t ts
echo ""
echo "=== Search for where Feature objects are created ==="
rg -n "category.*Feature\|Feature.*category" -t ts | head -20
echo ""
echo "=== Look at feature-related files in services ==="
git ls-files apps/server/src/services/ | grep -i feature
echo ""
echo "=== Check database schemas or migrations for category values ==="
git ls-files | grep -E "(schema|migration|seed|fixture)" | head -10Repository: AutoMaker-Org/automaker
Length of output: 3454
🏁 Script executed:
#!/bin/bash
# Get Feature type definition
echo "=== Feature type definition ==="
cat -n libs/types/src/feature.ts | head -80
echo ""
echo "=== Search for both mapping methods in ideation-service ==="
rg -n "mapIdeaCategoryToFeatureCategory|mapSuggestionCategoryToFeatureCategory" -A 15 apps/server/src/services/ideation-service.ts
echo ""
echo "=== Check test fixtures for feature data ==="
cat -n apps/server/tests/fixtures/configs.ts | head -150Repository: AutoMaker-Org/automaker
Length of output: 4841
🏁 Script executed:
#!/bin/bash
# Find IdeaCategory type definition
echo "=== IdeaCategory type definition ==="
rg -n "type IdeaCategory|enum IdeaCategory" -A 10 libs/types/
echo ""
echo "=== Search for actual feature category values in code ==="
rg -n "category.*:" apps/server/src/ -t ts --max-count=40 | grep -E "(Feature|UI|DX|Growth|Technical|Security|Performance|Accessibility|Analytics|feature|ui|growth)" | head -30
echo ""
echo "=== Check for CategoryAutocomplete component (used in edit dialog) ==="
rg -n "CategoryAutocomplete" -A 30 apps/ui/src/components/ui/ 2>/dev/null | head -50Repository: AutoMaker-Org/automaker
Length of output: 5974
🏁 Script executed:
#!/bin/bash
# Search for actual feature category examples in project files/data
echo "=== Search for category values in feature data files ==="
find . -name "features.json" -o -name "*.feature.json" 2>/dev/null | head -5
echo ""
echo "=== Search for category patterns across the codebase ==="
rg -n '"category"' -A 1 apps/server/src/ -t ts --max-count=50 | head -80
echo ""
echo "=== Check where ideas/suggestions are created with categories ==="
rg -n "AnalysisSuggestion|suggestion.*category" -B 2 -A 2 apps/server/src/ -t ts | head -60Repository: AutoMaker-Org/automaker
Length of output: 4845
🏁 Script executed:
#!/bin/bash
# Find AnalysisSuggestion type definition
echo "=== AnalysisSuggestion type definition ==="
rg -n "interface AnalysisSuggestion|type AnalysisSuggestion" -A 15 libs/types/
echo ""
echo "=== Search for where suggestions are converted to features ==="
rg -n "suggestionToFeature|suggestion.*Feature" apps/server/src/ -t ts | head -20
echo ""
echo "=== Check add-suggestion route that uses mapSuggestionCategoryToFeatureCategory ==="
cat -n apps/server/src/routes/ideation/routes/add-suggestion.ts | head -80Repository: AutoMaker-Org/automaker
Length of output: 3959
🏁 Script executed:
#!/bin/bash
# Search for issue #396 references
echo "=== Search for issue #396 context ==="
rg -n "#396|396" apps/server/src -t ts -B 3 -A 3
echo ""
echo "=== Look for existing category patterns in board/feature displays ==="
rg -n "category" apps/ui/src/components/views/board-view.tsx -B 2 -A 2 | head -40
echo ""
echo "=== Check if there are any test files that show expected categories ==="
git ls-files | grep -i "test\|spec" | grep -i "ideation\|suggestion" | head -5Repository: AutoMaker-Org/automaker
Length of output: 2238
🏁 Script executed:
#!/bin/bash
# Check the ideation service test file
echo "=== Ideation service tests ==="
cat -n apps/server/tests/unit/services/ideation-service.test.ts | head -300Repository: AutoMaker-Org/automaker
Length of output: 12614
🏁 Script executed:
#!/bin/bash
# Search for mapping function tests
echo "=== Search for category mapping tests ==="
rg -n "mapSuggestionCategoryToFeatureCategory|mapIdeaCategoryToFeatureCategory" -B 2 -A 10 apps/server/tests/ -t ts
echo ""
echo "=== Check board view to see what categories are actually displayed ==="
cat -n apps/ui/src/components/views/board-view.tsx | sed -n '255,290p'
echo ""
echo "=== Search for example features with categories ==="
rg -n "'Feature'|'UI'|'DX'|'Growth'" apps/ -t ts -t tsx | grep -v node_modules | grep -v test | head -20Repository: AutoMaker-Org/automaker
Length of output: 1928
🏁 Script executed:
#!/bin/bash
# Search for where capitalized categories might be used
echo "=== Search for Capitalized category patterns ==="
rg -n "Feature|Growth|Technical|Security|Performance|Accessibility|Analytics|DX|UI" apps/server/src/services/ideation-service.ts -C 1 | grep -A 2 -B 2 "mapping\|1687\|1688\|1689\|1690"
echo ""
echo "=== Look at feature-loader to see how categories are persisted ==="
rg -n "category" apps/server/src/services/feature-loader.ts -B 2 -A 2 | head -50
echo ""
echo "=== Search for where idea-to-feature conversion is tested ==="
cat -n apps/server/tests/unit/services/ideation-service.test.ts | tail -200Repository: AutoMaker-Org/automaker
Length of output: 9071
Category mapping standardizes format for consistency.
The mapping converts lowercase IdeaCategory values to capitalized feature categories, preventing duplicate lowercase and capitalized variants that could result from inconsistent casing. The mapping is correctly applied in the add-suggestion route (line 52) and serves as the single source of truth for idea/suggestion-to-feature conversion.
🤖 Prompt for AI Agents
In @apps/server/src/services/ideation-service.ts around lines 1684 - 1698, The
mapSuggestionCategoryToFeatureCategory function currently converts IdeaCategory
values to capitalized strings but may miss future categories; ensure the mapping
object in mapSuggestionCategoryToFeatureCategory exactly covers every variant of
the IdeaCategory union, keep its type as Record<IdeaCategory, string>, add any
missing category keys (using their exact IdeaCategory symbol names like feature,
'ux-ui', dx, growth, technical, security, performance, accessibility,
analytics), and keep the fallback to 'Feature'; then confirm the add-suggestion
route uses mapSuggestionCategoryToFeatureCategory for all idea->feature
conversions so the mapping remains the single source of truth.
- Fix misleading IPv6 comment (binds IPv4 interfaces for Docker compatibility) - Simplify directory creation by removing existsSync check (mkdir recursive is idempotent) - Convert sync file operations to async in deauth-claude.ts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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: 1
🤖 Fix all issues with AI agents
In @apps/server/src/routes/setup/routes/deauth-claude.ts:
- Around line 20-22: Update the top comment to reflect the actual async API
used: replace the reference to mkdirSync and the existsSync check with a note
that fs.mkdir(DATA_DIR, { recursive: true }) is async and idempotent; mention
DATA_DIR and the fs.mkdir call (not mkdirSync) so the comment matches the code
behavior and avoids confusion.
🧹 Nitpick comments (1)
apps/server/src/routes/setup/routes/deauth-claude.ts (1)
13-45: Consider emitting an event for frontend notification.Per coding guidelines, server operations should use
createEventEmitter()fromlib/events.tsto emit events that stream to frontend via WebSocket. The deauth operation changes application state that the frontend may need to react to.If this is intentionally deferred for a future PR, this can be ignored. Based on coding guidelines.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/server/src/index.tsapps/server/src/routes/setup/routes/deauth-claude.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/server/src/index.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
apps/server/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
createEventEmitter()fromlib/events.tsfor all server operations to emit events that stream to frontend via WebSocket
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
🔇 Additional comments (3)
apps/server/src/routes/setup/routes/deauth-claude.ts (3)
7-7: LGTM!Using
fs/promisesfor async operations is the correct approach and aligns with the PR objective of converting synchronous file operations to asynchronous.
10-11: LGTM!Using an environment variable with a sensible default for the data directory is a good approach for Docker compatibility. This cleanly addresses the permission issue in #395.
25-31: LGTM!The async
writeFilecorrectly writes the marker file with structured JSON content including a timestamp.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Make HOST configurable via env variable (default: localhost for security) - Add HOST=0.0.0.0 to Dockerfile for Docker container networking - Add specific error messages for EACCES, ENOENT, ENOSPC in deauth-claude Security: Server now binds to localhost by default instead of 0.0.0.0, preventing exposure to all network interfaces in non-Docker environments. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use path.resolve for DATA_DIR default (consistent absolute path) - Display actual host in startup banner (displayHost variable) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/server/src/index.ts (1)
540-563: Fix banner URL formatting for IPv6 hosts and use a deterministic default host.When
HOSTis set to an IPv6 address (e.g.,::1,::), the logged URLs will be malformed without bracket notation. Additionally, defaulting to'localhost'relies on OS resolver behavior;'127.0.0.1'is more deterministic for IPv4 loopback binding.Required changes:
- Change default host from
'localhost'to'127.0.0.1'(line 542)- Update
displayHostlogic to handle both'0.0.0.0'and'::'as wildcards (line 551)- Add bracket wrapping for IPv6 addresses before constructing URLs (new variable before logger.info)
Proposed diff
- // Default to localhost for security, use HOST=0.0.0.0 for Docker (fixes #428) - const host = process.env.HOST || 'localhost'; + // Default to loopback for security; use HOST=0.0.0.0 (IPv4) or HOST=:: (IPv6) for containers + const host = process.env.HOST || '127.0.0.1'; server.listen(port, host, () => { @@ - // Display localhost for 0.0.0.0 binding (accessible via localhost) - const displayHost = host === '0.0.0.0' ? 'localhost' : host; + // Display localhost for wildcard binds (commonly accessed via localhost with port-forwarding) + const displayHost = host === '0.0.0.0' || host === '::' ? 'localhost' : host; + const urlHost = + displayHost.includes(':') && !displayHost.startsWith('[') ? `[${displayHost}]` : displayHost; logger.info(` @@ -║ HTTP API: http://${displayHost}:${portStr} ║ -║ WebSocket: ws://${displayHost}:${portStr}/api/events ║ -║ Terminal: ws://${displayHost}:${portStr}/api/terminal/ws ║ -║ Health: http://${displayHost}:${portStr}/api/health ║ +║ HTTP API: http://${urlHost}:${portStr} ║ +║ WebSocket: ws://${urlHost}:${portStr}/api/events ║ +║ Terminal: ws://${urlHost}:${portStr}/api/terminal/ws ║ +║ Health: http://${urlHost}:${portStr}/api/health ║ ║ Terminal: ${terminalStatus.padEnd(37)}║ ╚═══════════════════════════════════════════════════════╝ `);
🧹 Nitpick comments (2)
apps/server/src/routes/setup/routes/deauth-claude.ts (2)
10-13: MakeDATA_DIRresolution consistent even when env var is set.If
DATA_DIRis provided as a relative path, current behavior depends on the runtime cwd; resolving it eliminates that ambiguity (and aligns better with “absolute path for consistent behavior” intent).Proposed diff
-// Default to ./data resolved to absolute path for consistent behavior -const DATA_DIR = process.env.DATA_DIR || path.resolve('./data'); +// Resolve to absolute path for consistent behavior (even if DATA_DIR is provided as relative) +const DATA_DIR = path.resolve(process.env.DATA_DIR ?? './data');
41-56: Consider whether returning rawerrorto clients is intended.You now provide a good user-facing
message, buterror: getErrorMessage(error)may still leak internals/paths; if this endpoint is hit by untrusted clients, consider gating the raw error behind a debug flag.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Dockerfileapps/server/src/index.tsapps/server/src/routes/setup/routes/deauth-claude.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/server/src/index.tsapps/server/src/routes/setup/routes/deauth-claude.ts
apps/server/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
createEventEmitter()fromlib/events.tsfor all server operations to emit events that stream to frontend via WebSocket
Files:
apps/server/src/index.tsapps/server/src/routes/setup/routes/deauth-claude.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/server/src/index.tsapps/server/src/routes/setup/routes/deauth-claude.ts
🔇 Additional comments (2)
apps/server/src/routes/setup/routes/deauth-claude.ts (1)
18-33: Marker file +mkdir({ recursive: true })flow looks solid (idempotent + Docker-friendly).Dockerfile (1)
143-147: No changes needed—the current implementation is correct.The comment in
apps/server/src/index.tsclarifies that issue #428 is about Docker container network access, not IPv6 support. The design intentionally defaults tolocalhost(security) and allowsHOST=0.0.0.0for Docker deployments. This is the correct and intentional behavior for the stated use case. There is no documented requirement for IPv6 support related to #428.
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: 1
🤖 Fix all issues with AI agents
In @apps/server/src/routes/setup/routes/deauth-claude.ts:
- Line 6: The import of logError in deauth-claude.ts must be changed to come
from a shared package: extract or re-export the createLogError implementation
(or a pre-configured logError function) currently in
apps/server/src/routes/common.ts into the shared package (e.g., @automaker/utils
or a dedicated @automaker/logger), export it there, then update deauth-claude.ts
to import logError from the shared package instead of ../common.js; ensure the
exported symbol name matches (createLogError or logError) and update any callers
to use that exported symbol.
🧹 Nitpick comments (2)
apps/server/src/routes/setup/routes/deauth-claude.ts (2)
17-39: Consider emitting an event for frontend WebSocket streaming.Per coding guidelines, server operations should use
createEventEmitter()fromlib/events.tsto emit events that stream to the frontend via WebSocket. This deauth state change seems like something the frontend would want to know about in real-time.#!/bin/bash # Check how other route handlers emit events rg -n "createEventEmitter|eventEmitter|emit\(" apps/server/src/routes --type ts -C 2
40-56: Consider handling additional filesystem error codes.The error handling for
EACCESandENOSPCis good. Consider also handlingEROFS(read-only filesystem) which can occur in containerized environments with mounted volumes.🔧 Suggested enhancement
let userMessage = 'Failed to disconnect Claude CLI'; if (nodeError.code === 'EACCES') { userMessage = 'Permission denied. Check directory permissions.'; } else if (nodeError.code === 'ENOSPC') { userMessage = 'No space left on device.'; + } else if (nodeError.code === 'EROFS') { + userMessage = 'Read-only filesystem. Check volume mount options.'; }
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/server/src/routes/setup/routes/deauth-claude.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
apps/server/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
createEventEmitter()fromlib/events.tsfor all server operations to emit events that stream to frontend via WebSocket
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
🔇 Additional comments (3)
apps/server/src/routes/setup/routes/deauth-claude.ts (3)
10-15: Good documentation of cross-file consistency requirements.The comments clearly document which files must stay in sync regarding the marker file location. This helps prevent drift between related components.
24-34: Async file operations look good.The switch from synchronous to asynchronous
fs/promisesoperations is correct. Usingrecursive: trueformkdirhandles the case where the directory already exists gracefully.
20-22: The implementation is correct and intentional.The marker files (
.claude-disconnected, etc.) are per-project artifacts stored in{projectRoot}/.automaker/, not application-level data. Usingprocess.cwd()is the correct approach and is consistently applied across all related files (get-claude-status.ts,auth-claude.ts,provider-factory.ts,cursor-status.ts,codex-status.ts).
DATA_DIRis reserved for application-level data (settings, credentials, API keys) that persists across projects, while per-project markers belong in each project's working directory. The file's own comment confirms this design is intentional for consistency.Likely an incorrect or invalid review comment.
| import type { Request, Response } from 'express'; | ||
| import { getErrorMessage, logError } from '../common.js'; | ||
| import * as fs from 'fs'; | ||
| import { logError } from '../common.js'; |
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.
🧩 Analysis chain
🏁 Script executed:
# Search for logError exports in shared packages and the codebase
rg "export.*logError" --type ts --type tsx --type js --type jsx -A 2Repository: AutoMaker-Org/automaker
Length of output: 94
🏁 Script executed:
# Check where common.js is located relative to the file
fd "common.js" apps/server/src/Repository: AutoMaker-Org/automaker
Length of output: 49
🏁 Script executed:
# Look for logError in @automaker packages
fd "@automaker" --type d | head -20Repository: AutoMaker-Org/automaker
Length of output: 49
🏁 Script executed:
# Search for logError exports without incorrect type flag
rg "export.*logError" --type ts -A 2Repository: AutoMaker-Org/automaker
Length of output: 3211
🏁 Script executed:
# Find common.js anywhere
fd "common\.js"Repository: AutoMaker-Org/automaker
Length of output: 49
🏁 Script executed:
# Check the actual import path - look at the file structure
cat -n apps/server/src/routes/setup/routes/deauth-claude.ts | head -20Repository: AutoMaker-Org/automaker
Length of output: 879
🏁 Script executed:
# Look for shared packages structure
git ls-files | grep -E "@automaker|packages|shared" | head -30Repository: AutoMaker-Org/automaker
Length of output: 1661
🏁 Script executed:
# Check if this relative import pattern is used consistently across all routes
rg "from ['\"]\.\.\/common\.(?:js|ts)['\"]" --type ts | head -20Repository: AutoMaker-Org/automaker
Length of output: 182
🏁 Script executed:
# Check if there's a shared packages directory or monorepo configuration
fd "package.json" | grep -E "(packages|shared)" | head -10Repository: AutoMaker-Org/automaker
Length of output: 49
🏁 Script executed:
# Look at the common.ts in setup to understand the pattern
cat -n apps/server/src/routes/setup/common.ts | head -30Repository: AutoMaker-Org/automaker
Length of output: 1001
🏁 Script executed:
# Check what's in the shared routes/common.js
cat -n apps/server/src/routes/common.jsRepository: AutoMaker-Org/automaker
Length of output: 131
🏁 Script executed:
# Look for @automaker packages that exist
fd "package.json" | xargs grep -l '"@automaker' | head -10Repository: AutoMaker-Org/automaker
Length of output: 312
🏁 Script executed:
# Find the common.ts file at routes level
fd "common\.ts" apps/server/src/routes/ | grep -v node_modulesRepository: AutoMaker-Org/automaker
Length of output: 1076
🏁 Script executed:
# Check the structure of lib packages to see what's exported
cat -n libs/utils/package.jsonRepository: AutoMaker-Org/automaker
Length of output: 1249
🏁 Script executed:
# Look at what's exported from @automaker/utils
fd "index\.(ts|js)" libs/utils/src/ -x cat -n {} \; | head -50Repository: AutoMaker-Org/automaker
Length of output: 1343
🏁 Script executed:
# Check the main routes/common.ts file
cat -n apps/server/src/routes/common.tsRepository: AutoMaker-Org/automaker
Length of output: 1271
🏁 Script executed:
# Check what's exported from @automaker/utils logger
cat -n libs/utils/src/logger.tsRepository: AutoMaker-Org/automaker
Length of output: 8647
Move logError to a shared package to comply with coding guidelines.
Per coding guidelines, imports must use shared packages (@automaker/*) rather than relative paths. Currently, logError is imported from the relative path ../common.js. The createLogError function exists in apps/server/src/routes/common.ts but is not exported from any shared package. Extract and export createLogError (or a pre-configured logError function) from @automaker/utils or a dedicated shared logger package, then import from there instead of using a relative path.
🤖 Prompt for AI Agents
In @apps/server/src/routes/setup/routes/deauth-claude.ts at line 6, The import
of logError in deauth-claude.ts must be changed to come from a shared package:
extract or re-export the createLogError implementation (or a pre-configured
logError function) currently in apps/server/src/routes/common.ts into the shared
package (e.g., @automaker/utils or a dedicated @automaker/logger), export it
there, then update deauth-claude.ts to import logError from the shared package
instead of ../common.js; ensure the exported symbol name matches (createLogError
or logError) and update any callers to use that exported symbol.
Fixes Greptile review finding: deauth was writing to DATA_DIR but other files (get-claude-status, auth-claude, provider-factory) read from process.cwd()/.automaker/. This broke the auth flow. Also addresses CodeRabbit security concern: - Remove sensitive paths from error responses - Keep detailed diagnostics in server logs only Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cc2dae0 to
7f218da
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: 0
🧹 Nitpick comments (2)
apps/server/src/routes/setup/routes/deauth-claude.ts (2)
40-58: Good security-conscious error handling.The approach of logging detailed errors server-side while returning sanitized messages to clients is excellent for security. The handling of
EACCES,ENOSPC, andEROFScovers the most common filesystem issues in containerized environments.💡 Optional: Consider adding EPERM handling
EPERM(operation not permitted) is distinct fromEACCESand can occur in certain container/SELinux configurations:} else if (nodeError.code === 'EROFS') { userMessage = 'Read-only filesystem. Check volume mounts.'; + } else if (nodeError.code === 'EPERM') { + userMessage = 'Operation not permitted. Check security policies.'; }
10-15: AUTOMAKER_DIR is not duplicated and does not need extraction; however, the.claude-disconnectedmarker constant should be centralized to avoid drift.
AUTOMAKER_DIRis defined only once in this file and is not duplicated elsewhere. However,.claude-disconnectedis inconsistently defined or hardcoded across multiple files—asDISCONNECTED_MARKERhere,DISCONNECTED_MARKER_FILEinget-claude-status.ts, and hardcoded strings inauth-claude.tsandprovider-factory.ts.Consider consolidating the disconnected marker constant to
libs/platform/src/paths.ts(which already centralizes path-related exports) rather than duplicating it across files.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/server/src/routes/setup/routes/deauth-claude.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
apps/server/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
createEventEmitter()fromlib/events.tsfor all server operations to emit events that stream to frontend via WebSocket
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/server/src/routes/setup/routes/deauth-claude.ts
🧠 Learnings (1)
📚 Learning: 2025-12-28T05:07:48.147Z
Learnt from: CR
Repo: AutoMaker-Org/automaker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T05:07:48.147Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always import from shared packages (automaker/*), never from old relative paths
Applied to files:
apps/server/src/routes/setup/routes/deauth-claude.ts
🔇 Additional comments (2)
apps/server/src/routes/setup/routes/deauth-claude.ts (2)
5-8: LGTM!The imports are appropriate:
fs/promisesfor async filesystem operations,pathfor cross-platform path handling, andlogErrorfrom a local utility within the same server app.
20-22: No action needed:process.cwd()is correct for project-specific marker files.The marker files (
.claude-disconnected, etc.) are project-specific and should be stored in each project's.automakerdirectory.DATA_DIRis reserved for application-level global data (settings.json, credentials.json, API keys, sessions), not project-specific state. This implementation is consistent across all CLI deauth/auth/status routes in the codebase.
Summary
0.0.0.0to support both IPv4 and IPv6bg-muted/50 dark:bg-zinc-950) for light mode compatibilityDATA_DIRenvironment variable for deauth-claude marker file to fix Docker permission errorsFeature,UI,DX, etc.) to prevent duplicate lowercase categoriesTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
UI Improvements
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.