Skip to content

fix(model): add backward compatibility for deprecated ccotel config key#182

Merged
AnnatarHe merged 1 commit intomainfrom
fix/model-backward-compat-ccotel-config
Dec 30, 2025
Merged

fix(model): add backward compatibility for deprecated ccotel config key#182
AnnatarHe merged 1 commit intomainfrom
fix/model-backward-compat-ccotel-config

Conversation

@AnnatarHe
Copy link
Copy Markdown
Contributor

Summary

  • Add backward compatibility for the ccotelaiCodeOtel config key rename from Implement OpenTelemetry support for Codex #181
  • Users with existing configs using ccotel will continue to work seamlessly
  • Silent migration at config read time (no deprecation warnings)

Changes

  • Add deprecated CCOtel field to ShellTimeConfig with old ccotel tags
  • Migrate ccotel to AICodeOtel in ReadConfigFile after unmarshal
  • Handle deprecated field in mergeConfig for local config overrides

Behavior

Config State Result
Only ccotel set Migrated to AICodeOtel, works ✓
Only aiCodeOtel set Works as-is ✓
Both set aiCodeOtel takes precedence ✓

Test plan

  • Existing config tests pass
  • Build succeeds

🤖 Generated with Claude Code

Support both ccotel (deprecated) and aiCodeOtel config keys to ensure
users with existing configs using the old key continue to work after
upgrading. The migration happens silently at config read time.

- Add deprecated CCOtel field to ShellTimeConfig with old tags
- Migrate ccotel to AICodeOtel in ReadConfigFile after unmarshal
- Handle deprecated field in mergeConfig for local config overrides

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @AnnatarHe, 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 addresses a configuration key rename by implementing backward compatibility. It ensures that applications can seamlessly handle older configurations that still use the ccotel key, migrating them silently to the new aiCodeOtel key during the configuration loading process. This prevents disruption for users and maintains expected behavior across different configuration versions.

Highlights

  • Backward Compatibility: Introduces backward compatibility for the ccotel configuration key, which was renamed to aiCodeOtel in a previous change.
  • Seamless Migration: Ensures that users with existing configurations using the deprecated ccotel key will continue to work without issues.
  • Silent Migration: The migration from ccotel to aiCodeOtel occurs silently during config read time, with no deprecation warnings.
  • Precedence Handling: If both ccotel and aiCodeOtel are present in a configuration, aiCodeOtel will take precedence.
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.

@AnnatarHe AnnatarHe merged commit e95bd0b into main Dec 30, 2025
2 checks passed
@AnnatarHe AnnatarHe deleted the fix/model-backward-compat-ccotel-config branch December 30, 2025 18:48
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 30, 2025

Codecov Report

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

Files with missing lines Patch % Lines
model/config.go 0.00% 3 Missing and 2 partials ⚠️
Flag Coverage Δ
unittests 19.93% <0.00%> (?)

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

Files with missing lines Coverage Δ
model/config.go 64.74% <0.00%> (-2.42%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
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 adds backward compatibility for the deprecated ccotel configuration key by migrating it to aiCodeOtel. The changes correctly handle this migration for both base and local configuration files, prioritizing the new key if both are present. The implementation is solid and aligns with the PR's goal. I've added one suggestion to refactor a small piece of logic in mergeConfig to improve code clarity and avoid modifying input parameters.

Comment thread model/config.go
Comment on lines +157 to 163
// Migrate deprecated ccotel from local config
if local.CCOtel != nil && local.AICodeOtel == nil {
local.AICodeOtel = local.CCOtel
}
if local.AICodeOtel != nil {
base.AICodeOtel = local.AICodeOtel
}
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.

medium

The current implementation for migrating the deprecated ccotel key modifies the local config object. While this works, it's generally better to avoid side effects on input parameters. A more direct approach would be to check both aiCodeOtel and the deprecated ccotel from the local config and update base accordingly, without modifying local.

This makes the function's behavior more predictable and self-contained.

	// Handle AICodeOtel from local config, with fallback to deprecated ccotel
	if local.AICodeOtel != nil {
		base.AICodeOtel = local.AICodeOtel
	} else if local.CCOtel != nil {
		base.AICodeOtel = local.CCOtel
	}

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