Skip to content

chore: add cost-safe GitHub Codespaces devcontainer#23

Open
eulicesl wants to merge 1 commit into
mainfrom
chore/codespaces-bootstrap-omi
Open

chore: add cost-safe GitHub Codespaces devcontainer#23
eulicesl wants to merge 1 commit into
mainfrom
chore/codespaces-bootstrap-omi

Conversation

@eulicesl

@eulicesl eulicesl commented Apr 12, 2026

Copy link
Copy Markdown
Owner

Summary

Add a baseline GitHub Codespaces devcontainer with cost-safe defaults for contributor onboarding.

Defaults

  • 2 CPU, 8 GB RAM, 32 GB storage
  • GitHub CLI + Python where needed
  • Light post-create bootstrap

Why

Makes cloud dev reproducible and quick while controlling spend.

Summary by CodeRabbit

  • Chores
    • Added a development container configuration to streamline environment setup in dev containers and Codespaces: uses a modern Node.js image with Python support, reserves minimal host resources, auto-installs recommended VS Code extensions, opens key documentation on start, and runs initial dependency installation (non-blocking on failure).

Copilot AI review requested due to automatic review settings April 12, 2026 13:40

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

A new devcontainer configuration was added to standardize a Node.js 22 (Bookworm) development environment with specified host resource requirements, GitHub CLI and Python 3.12 features, VS Code extensions, and a post-create npm install command.

Changes

Cohort / File(s) Summary
Dev Container Configuration
.devcontainer/devcontainer.json
Adds a devcontainer using Node.js 22 (Bookworm) image; requires 2 CPUs, 8GB RAM, 32GB storage; enables github-cli and Python 3.12 features; auto-installs ESLint and Python VS Code extensions; runs `postCreateCommand: npm install

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I have provisioned a shell so fine,
Node twenty-two, extensions in line.
Python and CLI stand at the gate,
Dependencies queued — initiate.
Workspace ready; begin your state.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding a GitHub Codespaces devcontainer configuration with cost-conscious resource defaults.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/codespaces-bootstrap-omi

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 .devcontainer/devcontainer.json configuration to provide a standardized development environment using a Node.js 22 image with Python 3.12 and GitHub CLI features. Feedback suggests improving the postCreateCommand to avoid silent failures and automate mandatory setup steps like Python dependency installation and pre-commit hook linking.

]
}
},
"postCreateCommand": "npm install || true"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The postCreateCommand uses || true to suppress errors, which can lead to silent setup failures and a broken environment for contributors. Additionally, it misses critical setup steps defined in the repository's documentation: AGENTS.md (line 11) states that installing the pre-commit hook is required, and the backend requires Python dependencies. Automating these ensures the "reproducible and quick" onboarding experience intended by this PR.

Suggested change
"postCreateCommand": "npm install || true"
"postCreateCommand": "(test -f package.json && npm install) && (test -f backend/requirements.txt && python3 -m pip install -r backend/requirements.txt) && ln -s -f ../../scripts/pre-commit .git/hooks/pre-commit"

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.devcontainer/devcontainer.json:
- Line 29: The postCreateCommand currently uses a fail-open pattern
("postCreateCommand": "npm install || true") which hides installation failures;
change the command to fail-fast by removing "|| true" and use a reproducible
install such as "npm ci" (or at minimum "npm install") so the container setup
exits non-zero on dependency errors; update the "postCreateCommand" entry (the
postCreateCommand key and its value) accordingly to ensure the devcontainer
build surfaces failures.
- Around line 10-13: The feature references
"ghcr.io/devcontainers/features/github-cli:1" and
"ghcr.io/devcontainers/features/python:1" are using mutable major tags; update
them to use fixed pins or a lockfile: replace the ":1" tags with a specific
semantic version (e.g., "ghcr.io/devcontainers/features/python:1.8.0") or an OCI
digest (e.g., "ghcr.io/devcontainers/features/python@sha256:<hash>"), or
alternatively run the devcontainer CLI to generate a devcontainer-lock.json and
reference that lockfile so the "ghcr.io/devcontainers/features/github-cli" and
"ghcr.io/devcontainers/features/python" entries resolve to immutable,
reproducible identifiers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b702c167-a089-43d8-8fa1-c3a7cbbbec13

📥 Commits

Reviewing files that changed from the base of the PR and between 8a9d5da and 4b4ea10.

📒 Files selected for processing (1)
  • .devcontainer/devcontainer.json

Comment on lines +10 to +13
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🌐 Web query:

Are devcontainer feature tags like ghcr.io/devcontainers/features/python:1 mutable over time, and what is the recommended way to pin features for reproducible environments?

💡 Result:

Yes, devcontainer feature tags like ghcr.io/devcontainers/features/python:1 are mutable over time because they are OCI image tags that can be updated to point to new content (e.g., new minor/patch versions within the major version). For reproducible environments, the recommended ways to pin features are: 1. Pin to a specific semantic version tag like ghcr.io/devcontainers/features/python:1.8.0 (minor and patch levels follow semver and can be updated). 2. For full reproducibility and immutability, pin directly to the OCI manifest digest (SHA256 hash), e.g., ghcr.io/devcontainers/features/python@sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511. Digests ensure the exact same feature content, as identical digests mean identical tgz contents and devcontainer-feature.json. 3. Use a devcontainer-lock.json lockfile generated by the devcontainer CLI, which records resolved digests, versions, and integrity checksums for all features and dependencies, enabling verifiable, reproducible builds.

Citations:


Kindly pin devcontainer features to explicit versions for reproducible builds.

The feature references at lines 10–13 employ mutable major version tags (:1), which may inadvertently introduce environmental drift during subsequent provisioning. For deterministic, reproducible deployments, I must insist you pin to one of the following approaches:

  1. Semantic versioning: ghcr.io/devcontainers/features/python:1.8.0
  2. OCI manifest digest: ghcr.io/devcontainers/features/python@sha256:<hash> for immutable precision
  3. Lockfile mechanism: Generate devcontainer-lock.json via the devcontainer CLI to record resolved digests and integrity checksums

Any of these measures would ensure identical feature content across all environments.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/devcontainer.json around lines 10 - 13, The feature references
"ghcr.io/devcontainers/features/github-cli:1" and
"ghcr.io/devcontainers/features/python:1" are using mutable major tags; update
them to use fixed pins or a lockfile: replace the ":1" tags with a specific
semantic version (e.g., "ghcr.io/devcontainers/features/python:1.8.0") or an OCI
digest (e.g., "ghcr.io/devcontainers/features/python@sha256:<hash>"), or
alternatively run the devcontainer CLI to generate a devcontainer-lock.json and
reference that lockfile so the "ghcr.io/devcontainers/features/github-cli" and
"ghcr.io/devcontainers/features/python" entries resolve to immutable,
reproducible identifiers.

]
}
},
"postCreateCommand": "npm install || true"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Sir, fail-open bootstrap undermines reproducibility.

Line 29 (npm install || true) masks dependency/setup failures, so contributors can land in a broken environment without any hard signal.

Suggested fix
-  "postCreateCommand": "npm install || true"
+  "postCreateCommand": "npm ci"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/devcontainer.json at line 29, The postCreateCommand currently
uses a fail-open pattern ("postCreateCommand": "npm install || true") which
hides installation failures; change the command to fail-fast by removing "||
true" and use a reproducible install such as "npm ci" (or at minimum "npm
install") so the container setup exits non-zero on dependency errors; update the
"postCreateCommand" entry (the postCreateCommand key and its value) accordingly
to ensure the devcontainer build surfaces failures.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a baseline GitHub Codespaces devcontainer configuration intended to standardize contributor onboarding while limiting resource usage.

Changes:

  • Introduces .devcontainer/devcontainer.json with a Node-based devcontainer image and minimum host requirements.
  • Adds devcontainer features for GitHub CLI and Python 3.12.
  • Configures default VS Code extensions, Codespaces open files, and a post-create npm install step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,30 @@
{
"name": "omi-fork-dev",
"image": "mcr.microsoft.com/devcontainers/javascript-node:22-bookworm",

Copilot AI Apr 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The devcontainer base image pins Node.js 22, but this repo’s CI workflows set up Node 18/20 (e.g., .github/workflows/lint.yml uses 18). Using a newer major here can cause dependency/install or lint/runtime mismatches between Codespaces and CI; consider switching the image to the same major used in CI (or explicitly document why Node 22 is required).

Suggested change
"image": "mcr.microsoft.com/devcontainers/javascript-node:22-bookworm",
"image": "mcr.microsoft.com/devcontainers/javascript-node:18-bookworm",

Copilot uses AI. Check for mistakes.
]
}
},
"postCreateCommand": "npm install || true"

Copilot AI Apr 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postCreateCommand uses npm install || true, which will silently ignore failed installs and leave the Codespace in a partially bootstrapped state that’s hard to debug. Prefer a deterministic install (e.g., npm ci when a lockfile is present) and avoid masking failures; if you need a non-blocking bootstrap, gate it on file existence instead of always swallowing errors.

Suggested change
"postCreateCommand": "npm install || true"
"postCreateCommand": "if [ -f package.json ]; then if [ -f package-lock.json ]; then npm ci; else npm install; fi; fi"

Copilot uses AI. Check for mistakes.
@eulicesl
eulicesl force-pushed the chore/codespaces-bootstrap-omi branch from 4b4ea10 to dfc9600 Compare April 27, 2026 19:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
.devcontainer/devcontainer.json (2)

29-29: ⚠️ Potential issue | 🟠 Major

Fail fast on dependency install; remove || true.

"postCreateCommand": "npm install || true" hides install failures, so Codespaces can start in a broken state (bad UX + harder debugging). Prefer npm ci (deterministic) and let the command fail if dependencies can’t be installed.

Proposed fix
-  "postCreateCommand": "npm install || true"
+  "postCreateCommand": "npm ci"
Suggested verification (confirm npm lockfile exists)
#!/bin/bash
# Read-only verification.
set -euo pipefail

ls -la package-lock.json yarn.lock pnpm-lock.yaml 2>/dev/null || true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/devcontainer.json at line 29, Replace the tolerant post-create
command that masks failures by updating the "postCreateCommand" value (currently
"npm install || true") to a strict, deterministic install such as "npm ci" and
remove the "|| true" so the container creation fails on install errors; ensure
the repo includes a lockfile (package-lock.json / yarn.lock / pnpm-lock.yaml) so
"npm ci" will succeed or otherwise keep "npm install" without the "|| true" to
allow visible failures.

10-14: ⚠️ Potential issue | 🟠 Major

Pin devcontainer features for reproducible builds (or use a lockfile).

Your :1 feature tags (github-cli:1, python:1) can drift over time, undermining the “reproducible & cost-safe” goal. Pin to explicit versions/digests, or generate and commit a devcontainer-lock.json so feature resolution is immutable.

Suggested verification (check for lockfile / resolved digests)
#!/bin/bash
# Read-only verification.
# Expected: If a devcontainer-lock.json exists, it should include resolved feature digests.

set -euo pipefail

if [[ -f ".devcontainer/devcontainer-lock.json" ]]; then
  echo "Found .devcontainer/devcontainer-lock.json"
  python - <<'PY'
import json, pathlib
p = pathlib.Path(".devcontainer/devcontainer-lock.json")
data = json.loads(p.read_text())
# Print top-level keys and a hint of feature resolution shape.
print("Top-level keys:", list(data.keys())[:20])
print("Has 'features' key:", 'features' in data or 'resolvedFeatures' in data)
PY
else
  echo "No .devcontainer/devcontainer-lock.json found."
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/devcontainer.json around lines 10 - 14, The devcontainer
features are using floating tags ("ghcr.io/devcontainers/features/github-cli:1"
and "ghcr.io/devcontainers/features/python:1") which can drift; update the
feature entries in .devcontainer/devcontainer.json to pin to explicit feature
versions or digests (replace the ":1" tags with the exact version/digest
strings) or generate and commit a devcontainer-lock.json (run the devcontainer
feature resolution to produce the lockfile) so feature resolution is immutable;
ensure the updated entries for the github-cli and python features reflect
resolved versions/digests and commit the lockfile if you choose that approach.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.devcontainer/devcontainer.json:
- Around line 1-30: The devcontainer currently pins Node 22 ("image":
"mcr.microsoft.com/devcontainers/javascript-node:22-bookworm") while CI
workflows use Node 18 and 20, causing inconsistent runtimes; pick a single Node
version and align all environments—either update the CI workflow job steps in
lint.yml and deploy_docs.yml (and entellegence_issues.yml) to use
actions/setup-node@v3 with node-version: '22' to match the devcontainer, or
change the devcontainer image to the project's canonical CI Node version; ensure
any package-lock or engines fields (package.json) are updated accordingly so all
local dev, Codespaces, and CI run the same Node major version.

---

Duplicate comments:
In @.devcontainer/devcontainer.json:
- Line 29: Replace the tolerant post-create command that masks failures by
updating the "postCreateCommand" value (currently "npm install || true") to a
strict, deterministic install such as "npm ci" and remove the "|| true" so the
container creation fails on install errors; ensure the repo includes a lockfile
(package-lock.json / yarn.lock / pnpm-lock.yaml) so "npm ci" will succeed or
otherwise keep "npm install" without the "|| true" to allow visible failures.
- Around line 10-14: The devcontainer features are using floating tags
("ghcr.io/devcontainers/features/github-cli:1" and
"ghcr.io/devcontainers/features/python:1") which can drift; update the feature
entries in .devcontainer/devcontainer.json to pin to explicit feature versions
or digests (replace the ":1" tags with the exact version/digest strings) or
generate and commit a devcontainer-lock.json (run the devcontainer feature
resolution to produce the lockfile) so feature resolution is immutable; ensure
the updated entries for the github-cli and python features reflect resolved
versions/digests and commit the lockfile if you choose that approach.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 68e144a9-0a66-402b-8545-13f7564029b6

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4ea10 and dfc9600.

📒 Files selected for processing (1)
  • .devcontainer/devcontainer.json

Comment on lines +1 to +30
{
"name": "omi-fork-dev",
"image": "mcr.microsoft.com/devcontainers/javascript-node:22-bookworm",
"hostRequirements": {
"cpus": 2,
"memory": "8gb",
"storage": "32gb"
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
}
},
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"ms-python.python"
]
},
"codespaces": {
"openFiles": [
"README.md",
"AGENTS.md"
]
}
},
"postCreateCommand": "npm install || true"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only verification.
set -euo pipefail

rg -n --hidden --glob '.github/workflows/**' "node-version" -S .github/workflows

Repository: eulicesl/omi-fork

Length of output: 261


Establish consistent Node version across Codespaces and CI pipelines.

The devcontainer specifies Node 22, yet your CI workflows employ three different Node versions: 18 in lint.yml and deploy_docs.yml, and 20 in entellegence_issues.yml. This fragmentation creates risk of inconsistent behavior between local development and pipeline execution. It is strongly recommended to standardize all environments to a single Node version—preferably by updating CI workflows to match the devcontainer's Node 22, or conversely, by aligning the devcontainer to the Node version designated for production CI processes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/devcontainer.json around lines 1 - 30, The devcontainer
currently pins Node 22 ("image":
"mcr.microsoft.com/devcontainers/javascript-node:22-bookworm") while CI
workflows use Node 18 and 20, causing inconsistent runtimes; pick a single Node
version and align all environments—either update the CI workflow job steps in
lint.yml and deploy_docs.yml (and entellegence_issues.yml) to use
actions/setup-node@v3 with node-version: '22' to match the devcontainer, or
change the devcontainer image to the project's canonical CI Node version; ensure
any package-lock or engines fields (package.json) are updated accordingly so all
local dev, Codespaces, and CI run the same Node major version.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfc96005b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pin devcontainer Python to 3.11

The devcontainer installs Python 3.12, but the backend runtime is pinned to Python 3.11 in the project Dockerfiles (backend/Dockerfile, backend/pusher/Dockerfile, backend/modal/Dockerfile, etc.). This mismatch makes Codespaces behavior non-representative: contributors can develop or run checks successfully on 3.12 while shipping code that fails in the 3.11 production/test images, which undermines the stated goal of reproducible onboarding.

Useful? React with 👍 / 👎.

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