-
Notifications
You must be signed in to change notification settings - Fork 7
pref(provider):完成OpenAI-compatible子包拆离 #219
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
6e993d0
17fa7f5
d2268e3
711fb1b
ffd3e3f
61ebc6c
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 |
|---|---|---|
|
|
@@ -22,15 +22,13 @@ type Loader struct { | |
| } | ||
|
|
||
| type persistedConfig struct { | ||
| SelectedProvider string `yaml:"selected_provider"` | ||
| CurrentModel string `yaml:"current_model"` | ||
| LegacyDefaultWorkdir *string `yaml:"default_workdir,omitempty"` | ||
| LegacyWorkdir *string `yaml:"workdir,omitempty"` | ||
| Shell string `yaml:"shell"` | ||
| MaxLoops int `yaml:"max_loops,omitempty"` | ||
| ToolTimeoutSec int `yaml:"tool_timeout_sec,omitempty"` | ||
| Context persistedContextConfig `yaml:"context,omitempty"` | ||
| Tools ToolsConfig `yaml:"tools,omitempty"` | ||
| SelectedProvider string `yaml:"selected_provider"` | ||
| CurrentModel string `yaml:"current_model"` | ||
| Shell string `yaml:"shell"` | ||
| MaxLoops int `yaml:"max_loops,omitempty"` | ||
| ToolTimeoutSec int `yaml:"tool_timeout_sec,omitempty"` | ||
| Context persistedContextConfig `yaml:"context,omitempty"` | ||
| Tools ToolsConfig `yaml:"tools,omitempty"` | ||
| } | ||
|
|
||
| type persistedContextConfig struct { | ||
|
|
@@ -182,16 +180,11 @@ func parseConfigWithContextDefaults(data []byte, contextDefaults ContextConfig) | |
|
|
||
| func parseCurrentConfig(data []byte, contextDefaults ContextConfig) (*Config, error) { | ||
| var file persistedConfig | ||
| if err := yaml.Unmarshal(data, &file); err != nil { | ||
| decoder := yaml.NewDecoder(bytes.NewReader(data)) | ||
| decoder.KnownFields(true) | ||
|
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. This changes the top-level config loader from the previous "read old keys, then rewrite to the canonical format" behavior into a hard startup failure for any existing
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.
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.
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. Switching the root config parser to
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. Switching the root config parser to |
||
| if err := decoder.Decode(&file); err != nil { | ||
| return nil, err | ||
| } | ||
| if file.LegacyDefaultWorkdir != nil { | ||
| return nil, fmt.Errorf("legacy config key %q is no longer supported", "default_workdir") | ||
| } | ||
| if file.LegacyWorkdir != nil { | ||
| return nil, fmt.Errorf("legacy config key %q is no longer supported", "workdir") | ||
| } | ||
|
|
||
| cfg := &Config{ | ||
| SelectedProvider: strings.TrimSpace(file.SelectedProvider), | ||
| CurrentModel: strings.TrimSpace(file.CurrentModel), | ||
|
|
||
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.
Dropping
workdirfrompersistedConfigremoves the only YAML-backed way to configure the default workspace, butConfig.Workdiris still validated and then fed into bootstrap, session storage, and tool sandbox setup. After this change a user can no longer persist a non-default workdir in~/.neocode/config.yaml: old files fail to load, and newly saved files silently omit the setting. That is a behavior regression, not just a cleanup.