fix(config): add serde(default) to TeeConfig fields#843
Open
fkztw wants to merge 1 commit intortk-ai:developfrom
Open
fix(config): add serde(default) to TeeConfig fields#843fkztw wants to merge 1 commit intortk-ai:developfrom
fkztw wants to merge 1 commit intortk-ai:developfrom
Conversation
… parse failure When users specify a partial [tee] section in config.toml (e.g. omitting max_file_size), the entire Config fails to deserialize. Because Config::load() errors are silently swallowed by unwrap_or_default() at call sites, all user settings (including hooks.exclude_commands) are silently ignored with no warning. Add #[serde(default = "...")] to every TeeConfig field so partial [tee] sections work correctly. Add tests for partial and empty deserialization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
11b6bd9 to
c5a3fd2
Compare
Contributor
|
Hey We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes No logic changes — only file moves and import path updates. What you need to doRebase your branch on git fetch origin && git rebase origin/developGit detects renames automatically. If you get import conflicts, update the paths: use crate::git; // now: use crate::cmds::git::git;
use crate::tracking; // now: use crate::core::tracking;
use crate::config; // now: use crate::core::config;
use crate::init; // now: use crate::hooks::init;
use crate::gain; // now: use crate::analytics::gain;Need help rebasing? Tag @aeppling |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TeeConfigfields lack#[serde(default)], causing the entireConfigdeserialization to fail when users specify a[tee]section inconfig.tomlbut omit some fields (e.g.max_file_size)Config::load().map(...).unwrap_or_default()to silently handle errors, all user settings (includinghooks.exclude_commands) are silently ignored with no warning#[serde(default = "...")]to everyTeeConfigfield so partial[tee]sections deserialize correctlyReproduction
When
rtk configis not called directly,Config::load()fails silently and falls back to defaults — all user settings are ignored without any warning.Test plan
cargo fmt --all --check— passedcargo clippy --all-targets— no new warningscargo test --all— 1116 passed, 3 ignoredtest_tee_config_partial_deserialize— verifies omittingmax_file_sizedoes not failtest_tee_config_empty_deserialize— verifies a completely empty[tee]section uses defaults🤖 Generated with Claude Code