-
Notifications
You must be signed in to change notification settings - Fork 0
feat(init): auto-install CC and Codex OTEL configs during init #248
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ import ( | |
|
|
||
| var InitCommand *cli.Command = &cli.Command{ | ||
| Name: "init", | ||
| Usage: "Initialize shelltime: authenticate, install hooks, and start daemon", | ||
| Usage: "Initialize shelltime: authenticate, install hooks, start daemon, and configure AI code integrations", | ||
| Flags: []cli.Flag{ | ||
| &cli.StringFlag{ | ||
| Name: "token", | ||
|
|
@@ -37,6 +37,16 @@ func commandInit(c *cli.Context) error { | |
| return err | ||
| } | ||
|
|
||
| // 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) | ||
| } | ||
|
Comment on lines
+40
to
+48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error handling for the new installation steps is inconsistent. A better long-term solution would be to refactor 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) |
||
|
|
||
| color.Green.Println("ShellTime is fully initialized and ready to use!") | ||
| 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.
🟡 Duplicate error message printed when Codex OTEL install fails during init
When
commandCodexInstallfails duringshelltime init, the user sees the same error message printed twice.Root Cause
commandCodexInstallatcommands/codex.go:37-39already prints the error and then returns it:Then
commandInitatcommands/init.go:46-48catches the returned error and prints it again:This is inconsistent with how
commandCCInstallworks — that function handles errors internally for each shell and always returnsnil(commands/cc.go:57), so the error handler ininit.go:41-43never 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
Was this helpful? React with 👍 or 👎 to provide feedback.