fix: harden qwen oauth flow (#1120) (thanks @mukhtharcm)
This commit is contained in:
@@ -6,6 +6,7 @@ Docs: https://docs.clawd.bot
|
|||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
- Tools: allow `sessions_spawn` to override thinking level for sub-agent runs.
|
- Tools: allow `sessions_spawn` to override thinking level for sub-agent runs.
|
||||||
|
- Models: add Qwen Portal OAuth provider support. (#1120) — thanks @mukhtharcm.
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Memory: apply OpenAI batch defaults even without explicit remote config.
|
- Memory: apply OpenAI batch defaults even without explicit remote config.
|
||||||
|
|||||||
@@ -100,11 +100,11 @@ async function pollDeviceToken(params: {
|
|||||||
return { status: "error", message: text || response.statusText };
|
return { status: "error", message: text || response.statusText };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.status === 400 && payload?.error === "authorization_pending") {
|
if (payload?.error === "authorization_pending") {
|
||||||
return { status: "pending" };
|
return { status: "pending" };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.status === 429 && payload?.error === "slow_down") {
|
if (payload?.error === "slow_down") {
|
||||||
return { status: "pending", slowDown: true };
|
return { status: "pending", slowDown: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { resolveClawdbotAgentDir } from "../agents/agent-paths.js";
|
||||||
import { resolveDefaultAgentId, resolveAgentDir, resolveAgentWorkspaceDir } from "../agents/agent-scope.js";
|
import { resolveDefaultAgentId, resolveAgentDir, resolveAgentWorkspaceDir } from "../agents/agent-scope.js";
|
||||||
import { upsertAuthProfile } from "../agents/auth-profiles.js";
|
import { upsertAuthProfile } from "../agents/auth-profiles.js";
|
||||||
import { normalizeProviderId } from "../agents/model-selection.js";
|
import { normalizeProviderId } from "../agents/model-selection.js";
|
||||||
@@ -23,7 +24,7 @@ function enableBundledPlugin(cfg: ClawdbotConfig): ClawdbotConfig {
|
|||||||
entries: {
|
entries: {
|
||||||
...cfg.plugins?.entries,
|
...cfg.plugins?.entries,
|
||||||
[PLUGIN_ID]: {
|
[PLUGIN_ID]: {
|
||||||
...(existingEntry ?? {}),
|
...existingEntry,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -108,7 +109,10 @@ export async function applyAuthChoiceQwenPortal(
|
|||||||
|
|
||||||
let nextConfig = enableBundledPlugin(params.config);
|
let nextConfig = enableBundledPlugin(params.config);
|
||||||
const agentId = params.agentId ?? resolveDefaultAgentId(nextConfig);
|
const agentId = params.agentId ?? resolveDefaultAgentId(nextConfig);
|
||||||
const agentDir = params.agentDir ?? resolveAgentDir(nextConfig, agentId);
|
const defaultAgentId = resolveDefaultAgentId(nextConfig);
|
||||||
|
const agentDir =
|
||||||
|
params.agentDir ??
|
||||||
|
(agentId === defaultAgentId ? resolveClawdbotAgentDir() : resolveAgentDir(nextConfig, agentId));
|
||||||
const workspaceDir =
|
const workspaceDir =
|
||||||
resolveAgentWorkspaceDir(nextConfig, agentId) ?? resolveDefaultAgentWorkspaceDir();
|
resolveAgentWorkspaceDir(nextConfig, agentId) ?? resolveDefaultAgentWorkspaceDir();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user