Skip to content

feat(init): auto-install CC and Codex OTEL configs during init#248

Merged
AnnatarHe merged 1 commit intomainfrom
feat/init-auto-install-otel-configs
Mar 1, 2026
Merged

feat(init): auto-install CC and Codex OTEL configs during init#248
AnnatarHe merged 1 commit intomainfrom
feat/init-auto-install-otel-configs

Conversation

@AnnatarHe
Copy link
Contributor

@AnnatarHe AnnatarHe commented Mar 1, 2026

Summary

  • Make shelltime init a one-stop setup by auto-installing Claude Code and Codex OTEL configurations after the daemon install step
  • Reuses existing commandCCInstall and commandCodexInstall which are already idempotent
  • Failures are non-blocking (logged but don't halt init)

Test plan

  • go build compiles successfully
  • go vet ./commands/... passes
  • go test ./commands/... ./model/... passes
  • Run shelltime init end-to-end and verify CC/Codex OTEL configs are installed

🤖 Generated with Claude Code


Open with Devin

Make `shelltime init` a true one-stop setup by automatically installing
Claude Code and Codex OTEL configurations after daemon install. Failures
are non-blocking to avoid halting the init process.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 enhances the shelltime init command by integrating the automatic installation of Claude Code and Codex OpenTelemetry configurations. This change aims to provide a more comprehensive and seamless initial setup experience for users, ensuring that AI code integration tools are configured as part of the core initialization flow without interrupting the process on failure.

Highlights

  • Automated AI Config Installation: The shelltime init command now automatically installs Claude Code and Codex OTEL configurations, streamlining the setup process.
  • Idempotent Reusability: Existing commandCCInstall and commandCodexInstall functions are reused, ensuring that repeated installations are handled gracefully.
  • Non-Blocking Failures: Installation failures for the AI configurations are logged but do not halt the overall initialization process, allowing shelltime init to complete.
Changelog
  • commands/init.go
    • Updated the init command's usage description to reflect the new AI code integration setup.
    • Added calls to commandCCInstall and commandCodexInstall within the init command's execution flow.
    • Implemented error handling for the new installation steps, logging failures without stopping the initialization.
Activity
  • No specific human activity (comments, reviews, progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
commands/init.go 0.00% 4 Missing ⚠️
Flag Coverage Δ
unittests 37.44% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
commands/init.go 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment on lines +46 to +48
if err := commandCodexInstall(c); err != nil {
color.Red.Printf("Failed to install Codex OTEL config: %v\n", err)
}

Choose a reason for hiding this comment

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

🟡 Duplicate error message printed when Codex OTEL install fails during init

When commandCodexInstall fails during shelltime init, the user sees the same error message printed twice.

Root Cause

commandCodexInstall at commands/codex.go:37-39 already prints the error and then returns it:

if err := service.Install(); err != nil {
    color.Red.Printf("Failed to install Codex OTEL config: %v\n", err)
    return err
}

Then commandInit at commands/init.go:46-48 catches the returned error and prints it again:

if err := commandCodexInstall(c); err != nil {
    color.Red.Printf("Failed to install Codex OTEL config: %v\n", err)
}

This is inconsistent with how commandCCInstall works — that function handles errors internally for each shell and always returns nil (commands/cc.go:57), so the error handler in init.go:41-43 never triggers.

Impact: When Codex OTEL config installation fails during shelltime init, the user sees two nearly identical red error lines, which is confusing.

Prompt for agents
There are two reasonable approaches to fix the duplicate error message:

Option A (preferred): Make commandCodexInstall consistent with commandCCInstall by not returning the error after printing it. In commands/codex.go, lines 37-39, remove the `return err` so the function always returns nil (matching the pattern used in commandCCInstall). This way init.go's error handler won't trigger.

Option B: In commands/init.go lines 46-48, don't print the error since commandCodexInstall already prints it. Change to just: `_ = commandCodexInstall(c)` or `commandCodexInstall(c) //nolint:errcheck`. But this loses the ability to detect failure from the caller side.

Option A is cleaner as it makes both CC and Codex install functions behave the same way.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 extends the init command to automatically install configurations for Claude Code and Codex. The implementation reuses existing installation commands. My review identifies an issue with inconsistent error handling in the init command when calling these sub-commands, which leads to dead code and duplicate error logging. I've provided a suggestion to make the code clearer and fix these issues within the scope of the changed file.

Comment on lines +40 to +48
// Step 4: Install Claude Code OTEL configuration
if err := commandCCInstall(c); err != nil {
color.Red.Printf("Failed to install Claude Code OTEL config: %v\n", err)
}

// Step 5: Install Codex OTEL configuration
if err := commandCodexInstall(c); err != nil {
color.Red.Printf("Failed to install Codex OTEL config: %v\n", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The error handling for the new installation steps is inconsistent. commandCCInstall always returns nil (making the error check on line 41 dead code), while commandCodexInstall logs an error and also returns it (leading to duplicate logging on line 47).

A better long-term solution would be to refactor commandCCInstall to return errors and commandCodexInstall to not log them, letting commandInit handle all logging centrally.

For an immediate improvement within this file, you can adjust the calls to reflect the current behavior of the sub-commands. This avoids the dead code and duplicate logging issues.

	// Step 4: Install Claude Code OTEL configuration
	// commandCCInstall handles its own logging and does not return errors.
	commandCCInstall(c)

	// Step 5: Install Codex OTEL configuration
	// commandCodexInstall handles its own error logging, so we ignore the returned error here to avoid duplicate logs.
	_ = commandCodexInstall(c)

@AnnatarHe AnnatarHe merged commit add2029 into main Mar 1, 2026
6 of 7 checks passed
@AnnatarHe AnnatarHe deleted the feat/init-auto-install-otel-configs branch March 1, 2026 04:10
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.

1 participant