Open
Conversation
Collaborator
tusharmath
commented
Mar 24, 2026
- feat(forge_config): add forge configuration crate and loader
- refactor(forge_config): switch config serde to snake_case
- refactor(forge_config): load global config with oncecell panic-on-fail
- feat(forge_config): load user config from home directory
- refactor(forge_config): rename retry and parallel read config fields
- refactor(forge_config): add provider and model selection fields
- feat(forge_config): add FORGE env var overrides for config
- refactor(forge_config): switch config loading from json to toml
- chore(forge_config): add default toml config for tool limits
- refactor(forge_config): rename forge_config module to config
- refactor(forge_config): switch to async config reader/writer
- feat(forge_config): add merge strategies to config structs
- feat(forge_config): implement multi-source config loading order
- refactor(forge_config): remove merge derive and use toml_edit serialization
- refactor(forge_config): load config from resolved path
- feat(forge_config): add temperature, sampling, update, compact types
- feat(forge_config): add tool limits and compact/update config
- refactor(forge_config): make config path optional in reader
- refactor(forge_repo): decouple disk appconfig from domain type
- refactor(domain): rename AppConfig to ForgeConfig everywhere
41a0729 to
5ce8133
Compare
5ce8133 to
f12fe62
Compare
Comment on lines
+68
to
+71
| impl From<f32> for Temperature { | ||
| fn from(value: f32) -> Self { | ||
| Temperature::new_unchecked(value) | ||
| } |
Contributor
There was a problem hiding this comment.
The From<f32> implementation for Temperature bypasses validation by calling new_unchecked(). This allows creating invalid Temperature values (outside the 0.0-2.0 range) in production builds where debug assertions are disabled.
Impact: Code like Temperature::from(5.0) will create an invalid state that violates the type's invariants, potentially causing incorrect behavior downstream.
Fix: Remove this implementation or change to TryFrom:
impl TryFrom<f32> for Temperature {
type Error = String;
fn try_from(value: f32) -> Result<Self, Self::Error> {
Temperature::new(value)
}
}
Suggested change
| impl From<f32> for Temperature { | |
| fn from(value: f32) -> Self { | |
| Temperature::new_unchecked(value) | |
| } | |
| impl TryFrom<f32> for Temperature { | |
| type Error = String; | |
| fn try_from(value: f32) -> Result<Self, Self::Error> { | |
| Temperature::new(value) | |
| } | |
| } |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
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.