colana 1.0.0-beta.71 → 1.0.0-beta.73
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/package.json
CHANGED
|
@@ -48,15 +48,20 @@ export function createAgentControlRoutes(app, { agentLimiter, ptyManager, ptyAva
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// License: check agent limit before starting.
|
|
51
|
-
// Personal agents (OpenClaw)
|
|
51
|
+
// Personal agents (OpenClaw) bypass the session cap entirely — they're
|
|
52
|
+
// a different category from coding agents and shouldn't block or be blocked.
|
|
53
|
+
const requestedProvider = req.body.provider || 'gemini';
|
|
54
|
+
const requestedProviderDef = config.providers[requestedProvider];
|
|
52
55
|
const activeSessions = getActiveSessions();
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
if (!requestedProviderDef?.isPersonal) {
|
|
57
|
+
const activeSessCount = activeSessions.filter(s => {
|
|
58
|
+
const providerDef = config.providers[s.provider];
|
|
59
|
+
return !providerDef?.isPersonal;
|
|
60
|
+
}).length;
|
|
61
|
+
const agentCheck = canStartAgent(activeSessCount);
|
|
62
|
+
if (!agentCheck.allowed) {
|
|
63
|
+
return res.status(403).json({ error: agentCheck.reason, code: 'AGENT_LIMIT', tier: agentCheck.tier });
|
|
64
|
+
}
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
const {
|
package/server/preflight.js
CHANGED
|
@@ -12,7 +12,7 @@ import fs from 'fs';
|
|
|
12
12
|
import config from './config.js';
|
|
13
13
|
import { commandExistsSync, resolveNpmGlobalEntryPoint } from './platform.js';
|
|
14
14
|
import { isGitRepo } from './git-ops.js';
|
|
15
|
-
import { readAuthStore, getOpenClawConfig } from './openclaw-config.js';
|
|
15
|
+
import { readAuthStore, getOpenClawConfig, syncAuthProfilesFromEnv } from './openclaw-config.js';
|
|
16
16
|
import { refreshPathAfterInstall } from './auto-installer.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -198,6 +198,8 @@ function checkAiderGitRepo(projectPath) {
|
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
200
|
* OpenClaw checks: config must exist and auth profiles must have at least one key.
|
|
201
|
+
* Syncs environment API keys (e.g. ANTHROPIC_API_KEY from Settings) into OpenClaw's
|
|
202
|
+
* auth-profiles.json before checking, so keys saved in Colana are available to the gateway.
|
|
201
203
|
*/
|
|
202
204
|
function checkOpenClawConfig() {
|
|
203
205
|
const cfg = getOpenClawConfig();
|
|
@@ -211,6 +213,12 @@ function checkOpenClawConfig() {
|
|
|
211
213
|
};
|
|
212
214
|
}
|
|
213
215
|
|
|
216
|
+
// Sync API keys from process.env (loaded from Colana Settings) into OpenClaw's
|
|
217
|
+
// auth-profiles.json. This ensures keys saved via the wizard or Settings panel
|
|
218
|
+
// are available before we check — otherwise the gateway ensure (which also syncs)
|
|
219
|
+
// never gets reached because this preflight fails first.
|
|
220
|
+
syncAuthProfilesFromEnv();
|
|
221
|
+
|
|
214
222
|
const store = readAuthStore();
|
|
215
223
|
const hasKey = Object.values(store.profiles || {}).some(p => p.key);
|
|
216
224
|
if (!hasKey) {
|