Fix CI typecheck and default OpenClaw sessions to issue scope
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
"picocolors": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.6.0",
|
||||
"typescript": "^5.7.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
"rootDir": "src",
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ By default the adapter sends a signed `device` payload in `connect` params.
|
||||
|
||||
The adapter supports the same session routing model as HTTP OpenClaw mode:
|
||||
|
||||
- `sessionKeyStrategy=fixed|issue|run`
|
||||
- `sessionKeyStrategy=issue|fixed|run`
|
||||
- `sessionKey` is used when strategy is `fixed`
|
||||
|
||||
Resolved session key is sent as `agent.sessionKey`.
|
||||
|
||||
@@ -250,8 +250,7 @@ POST /api/companies/$CLA_COMPANY_ID/invites
|
||||
"headers": { "x-openclaw-token": "<gateway-token>" },
|
||||
"role": "operator",
|
||||
"scopes": ["operator.admin"],
|
||||
"sessionKeyStrategy": "fixed",
|
||||
"sessionKey": "paperclip",
|
||||
"sessionKeyStrategy": "issue",
|
||||
"waitTimeoutMs": 120000
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,6 @@ Request behavior fields:
|
||||
- paperclipApiUrl (string, optional): absolute Paperclip base URL advertised in wake text
|
||||
|
||||
Session routing fields:
|
||||
- sessionKeyStrategy (string, optional): fixed (default), issue, or run
|
||||
- sessionKeyStrategy (string, optional): issue (default), fixed, or run
|
||||
- sessionKey (string, optional): fixed session key when strategy=fixed (default paperclip)
|
||||
`;
|
||||
|
||||
@@ -117,9 +117,9 @@ function parseBoolean(value: unknown, fallback = false): boolean {
|
||||
}
|
||||
|
||||
function normalizeSessionKeyStrategy(value: unknown): SessionKeyStrategy {
|
||||
const normalized = asString(value, "fixed").trim().toLowerCase();
|
||||
if (normalized === "issue" || normalized === "run") return normalized;
|
||||
return "fixed";
|
||||
const normalized = asString(value, "issue").trim().toLowerCase();
|
||||
if (normalized === "fixed" || normalized === "run") return normalized;
|
||||
return "issue";
|
||||
}
|
||||
|
||||
function resolveSessionKey(input: {
|
||||
|
||||
@@ -5,8 +5,7 @@ export function buildOpenClawGatewayConfig(v: CreateConfigValues): Record<string
|
||||
if (v.url) ac.url = v.url;
|
||||
ac.timeoutSec = 120;
|
||||
ac.waitTimeoutMs = 120000;
|
||||
ac.sessionKeyStrategy = "fixed";
|
||||
ac.sessionKey = "paperclip";
|
||||
ac.sessionKeyStrategy = "issue";
|
||||
ac.role = "operator";
|
||||
ac.scopes = ["operator.admin"];
|
||||
return ac;
|
||||
|
||||
@@ -72,7 +72,7 @@ When used directly (SSE mode or webhook fallback), payload uses OpenResponses sh
|
||||
"model": "openclaw",
|
||||
"input": "...",
|
||||
"metadata": {
|
||||
"paperclip_session_key": "paperclip"
|
||||
"paperclip_session_key": "paperclip:issue:ISSUE_ID"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -91,7 +91,7 @@ You can provide auth either explicitly or via token headers:
|
||||
|
||||
Session keys are resolved from:
|
||||
|
||||
- `sessionKeyStrategy`: `fixed` (default), `issue`, `run`
|
||||
- `sessionKeyStrategy`: `issue` (default), `fixed`, `run`
|
||||
- `sessionKey`: used when strategy is `fixed` (default value `paperclip`)
|
||||
|
||||
Where session keys are applied:
|
||||
|
||||
@@ -28,7 +28,7 @@ Core fields:
|
||||
- hookIncludeSessionKey (boolean, optional): when true, include derived \`sessionKey\` in \`/hooks/agent\` webhook payloads (default false)
|
||||
|
||||
Session routing fields:
|
||||
- sessionKeyStrategy (string, optional): \`fixed\` (default), \`issue\`, or \`run\`
|
||||
- sessionKeyStrategy (string, optional): \`issue\` (default), \`fixed\`, or \`run\`
|
||||
- sessionKey (string, optional): fixed session key value when strategy is \`fixed\` (default \`paperclip\`)
|
||||
|
||||
Operational fields:
|
||||
|
||||
@@ -57,9 +57,9 @@ export function resolvePaperclipApiUrlOverride(value: unknown): string | null {
|
||||
}
|
||||
|
||||
export function normalizeSessionKeyStrategy(value: unknown): SessionKeyStrategy {
|
||||
const normalized = asString(value, "fixed").trim().toLowerCase();
|
||||
if (normalized === "issue" || normalized === "run") return normalized;
|
||||
return "fixed";
|
||||
const normalized = asString(value, "issue").trim().toLowerCase();
|
||||
if (normalized === "fixed" || normalized === "run") return normalized;
|
||||
return "issue";
|
||||
}
|
||||
|
||||
export function resolveSessionKey(input: {
|
||||
|
||||
@@ -6,7 +6,6 @@ export function buildOpenClawConfig(v: CreateConfigValues): Record<string, unkno
|
||||
ac.method = "POST";
|
||||
ac.timeoutSec = 0;
|
||||
ac.streamTransport = "sse";
|
||||
ac.sessionKeyStrategy = "fixed";
|
||||
ac.sessionKey = "paperclip";
|
||||
ac.sessionKeyStrategy = "issue";
|
||||
return ac;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user