@clawdreyhepburn/carapace 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -32
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -773,38 +773,6 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
-
// Clean up per-agent models.json (this is what actually routes API calls)
|
|
777
|
-
const agentModelsPath = join(homedir(), ".openclaw", "agents", "main", "agent", "models.json");
|
|
778
|
-
if (existsSync(agentModelsPath)) {
|
|
779
|
-
try {
|
|
780
|
-
const agentModels = JSON.parse(readFileSync(agentModelsPath, "utf-8"));
|
|
781
|
-
let modelsChanged = false;
|
|
782
|
-
if (agentModels.providers) {
|
|
783
|
-
for (const [name, provCfg] of Object.entries(agentModels.providers)) {
|
|
784
|
-
if ((provCfg as any)?.baseUrl === proxyUrl) {
|
|
785
|
-
if ((provCfg as any)._originalBaseUrl) {
|
|
786
|
-
(provCfg as any).baseUrl = (provCfg as any)._originalBaseUrl;
|
|
787
|
-
delete (provCfg as any)._originalBaseUrl;
|
|
788
|
-
} else {
|
|
789
|
-
delete (provCfg as any).baseUrl;
|
|
790
|
-
}
|
|
791
|
-
// Remove empty provider entries (but keep ones with other config)
|
|
792
|
-
const remaining = Object.keys(provCfg as any).filter(k => k !== 'models' || (provCfg as any).models?.length > 0);
|
|
793
|
-
if (remaining.length === 0) delete agentModels.providers[name];
|
|
794
|
-
modelsChanged = true;
|
|
795
|
-
console.log(` ✅ Cleaned proxy baseUrl from models.json (${name})`);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
if (modelsChanged) {
|
|
800
|
-
writeFileSync(agentModelsPath, JSON.stringify(agentModels, null, 2) + "\n", "utf-8");
|
|
801
|
-
changed = true;
|
|
802
|
-
}
|
|
803
|
-
} catch (e: any) {
|
|
804
|
-
console.log(` ⚠️ Could not clean models.json: ${e.message}`);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
|
|
808
776
|
// Disable the plugin entry (don't delete — user might want to re-enable)
|
|
809
777
|
if (cfg.plugins?.entries?.carapace?.enabled) {
|
|
810
778
|
cfg.plugins.entries.carapace.enabled = false;
|