Skip to content

fix: keep devcontainer setup running after Kiro failure#2864

Open
wondr-wclabs wants to merge 1 commit into
github:mainfrom
wondr-wclabs:fix/2605-devcontainer-kiro-optional
Open

fix: keep devcontainer setup running after Kiro failure#2864
wondr-wclabs wants to merge 1 commit into
github:mainfrom
wondr-wclabs:fix/2605-devcontainer-kiro-optional

Conversation

@wondr-wclabs

Copy link
Copy Markdown

Summary

Fixes #2605.

The devcontainer post-create.sh script used the fatal run_command wrapper for every Kiro installer step. When the upstream Kiro installer URL returns 404, that exits the whole post-create script and prevents later tools from installing, including Kimi CLI, CodeBuddy, uv, and DocFx.

This keeps the pinned Kiro installer checksum verification in place when the installer is available, but makes the Kiro block non-blocking:

  • adds run_optional_command for installer steps that should warn and continue;
  • applies it only to the Kiro install/check flow;
  • preserves fatal behavior for the rest of the setup script;
  • adds a regression check that the Kiro block does not contain a direct exit 1 and advertises continued setup.

The reason for limiting the optional behavior to Kiro is that #2605 is caused by one unavailable optional upstream installer. Making every devcontainer install non-fatal would hide real setup failures for core tooling.

Validation

  • bash -n .devcontainer/post-create.sh
  • uv run python -m pytest tests/test_agent_config_consistency.py -q — 30 passed
  • uv run python -m pytest tests/integrations/test_integration_kiro_cli.py tests/test_agent_config_consistency.py -q — 55 passed
  • git diff --check
  • uv run python -m pytest -q — 3576 passed, 45 skipped

AI assistance disclosure

This PR was developed with AI assistance from Codex/ChatGPT for codebase inspection, implementation, and validation. I reviewed the diff and test output before submitting.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the devcontainer bootstrap more resilient by ensuring a transient failure downloading/installing Kiro CLI (e.g., upstream 404) doesn’t abort the rest of .devcontainer/post-create.sh, so subsequent tooling (Kimi, CodeBuddy, uv, DocFx) still installs.

Changes:

  • Added a non-fatal command wrapper (run_optional_command) and applied it to the Kiro install + verification flow while keeping other installs fatal.
  • Added a regression test to assert the Kiro block uses the optional wrapper, avoids direct exit 1, and explicitly indicates setup will continue.
Show a summary per file
File Description
.devcontainer/post-create.sh Introduces run_optional_command and makes the Kiro installation path non-blocking while preserving checksum verification when available.
tests/test_agent_config_consistency.py Adds a regression check to ensure the Kiro block remains non-blocking and advertises continued setup.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +24 to +25
# Function to run an optional command and continue on error
run_optional_command() {

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 3

fi
}

# Function to run an optional command and continue on error
Comment on lines +34 to +36
echo -e "\033[0;33m[WARN] Optional command failed (Exit Code $exit_code): $command_to_run\033[0m" >&2
echo -e "\033[0;33m$output\033[0m" >&2
return $exit_code
)[0]

assert "run_optional_command" in kiro_block
assert "exit 1" not in kiro_block
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.

[Bug]: devcontainer post-create.sh fails on Kiro CLI 404, blocking uv, DocFx, Kimi and CodeBuddy installs

3 participants