Release v0.2.0
⚙️ Configuration-Driven Architecture Refactoring
This release migrates all previously hardcoded constants to the configuration system, allowing users to customize various parameters according to their needs.
New Configuration Options
1. Network Configuration [network]
Control HTTP request behavior:
[network]
request_timeout = 120 # HTTP request timeout (seconds)
connect_timeout = 10 # HTTP connection timeout (seconds)
max_retries = 3 # Max retry attempts on API request failure
retry_delay_ms = 1000 # Initial retry delay (milliseconds, exponential backoff)2. File Configuration [file]
Control file size limits:
[file]
max_size = 10485760 # Max file size (bytes, default 10MB)3. LLM Parameter Configuration
Each provider can now explicitly configure max_tokens and temperature:
[llm.providers.claude]
api_key = "sk-ant-..."
model = "claude-sonnet-4-5-20250929"
max_tokens = 2000 # Max response tokens
temperature = 0.3 # Generation temperature4. Commit Retry Count
[commit]
max_retries = 10 # Max manual retry attemptsArchitecture Improvements
Removed constants.rs
No longer using a centralized constants file. Each module manages its own default values:
| Original Constant | New Location |
|---|---|
DEFAULT_MAX_TOKENS | src/llm/provider/base.rs |
DEFAULT_TEMPERATURE | src/llm/provider/base.rs |
ERROR_PREVIEW_LENGTH | src/llm/provider/base.rs |
MAX_FEEDBACK_LENGTH | src/ui/prompt.rs |
| Prompt templates | src/llm/prompt.rs |
Configuration Priority
All parameters support config file overrides while maintaining backward compatibility:
- Config file value (if set)
- Default value (if not set)
Breaking Changes
⚠️ API Changes (only affects library users):
// Before
let repo = GitRepository::open()?;
// Now
let repo = GitRepository::open(None)?; // Use default config
let repo = GitRepository::open(Some(&config.file))?; // Use custom configUpgrade Notes
Upgrading from v0.1.6 requires no configuration changes.
All new configuration options have default values matching previous hardcoded values:
network.request_timeout= 120network.connect_timeout= 10network.max_retries= 3network.retry_delay_ms= 1000file.max_size= 10485760 (10MB)commit.max_retries= 10
If you need to customize, add the corresponding configuration to ~/.config/gcop/config.toml.
Configuration Example
Complete configuration example:
[llm]
default_provider = "claude"
[llm.providers.claude]
api_key = "sk-ant-..."
model = "claude-sonnet-4-5-20250929"
max_tokens = 4000 # Increase response length
temperature = 0.5 # Slightly increase creativity
[commit]
max_retries = 5 # Reduce retry count
[network]
request_timeout = 60 # Shorten timeout
max_retries = 5 # Increase auto retry count
[file]
max_size = 5242880 # Limit to 5MB📦 Installation
cargo install gcop-rsOr build from source:
git clone https://github.com/AptS-1547/gcop-rs.git
cd gcop-rs
cargo build --release📚 Documentation
Feedback & Contributions
If you have any issues or suggestions, please submit an Issue.