@tnunamak/dalan 0.5.2 → 0.6.0
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/CHANGELOG.md +29 -25
- package/PROTOCOL.md +16 -4
- package/README.md +127 -260
- package/SECURITY.md +1 -1
- package/bin/dalan.mjs +5 -0
- package/bin/dot-worker.mjs +35 -26
- package/docs/chatgpt-worker-onboarding.md +5 -5
- package/docs/claude-worker-onboarding.md +5 -5
- package/docs/codex-to-muse.md +175 -0
- package/docs/connect-chatgpt.md +9 -4
- package/docs/connection-longevity.md +7 -1
- package/docs/dalan-upgrade.md +17 -13
- package/docs/deadman.md +5 -3
- package/docs/local-agent-mcp.md +8 -6
- package/docs/manual-setup.md +8 -8
- package/docs/mirror-fetch.md +1 -2
- package/docs/operations.md +90 -42
- package/docs/operator-duties.md +1 -1
- package/docs/owner-integrator.md +2 -2
- package/docs/portable-auth-profile.md +12 -14
- package/docs/pr-head-reviewer.md +21 -5
- package/docs/pr-preflight.md +2 -0
- package/docs/pull-queue.md +131 -0
- package/docs/pull-workers.md +7 -10
- package/docs/redaction.md +1 -1
- package/docs/service-setup.md +56 -3
- package/docs/setup-reference.md +1 -1
- package/docs/t3-integration.md +2 -0
- package/docs/t3-result-retry-delivery.md +2 -2
- package/docs/t3-reverse-control.md +7 -7
- package/docs/usage.md +19 -15
- package/docs/worker-clients.md +18 -13
- package/package.json +3 -1
- package/scripts/dalan-try-selfcheck.mjs +29 -0
- package/scripts/worker-bridge-setup.mjs +1 -1
- package/src/acp-bridge.mjs +18 -12
- package/src/as.mjs +41 -0
- package/src/child-exit.mjs +18 -0
- package/src/child-registry.mjs +94 -0
- package/src/cli-help.mjs +25 -11
- package/src/demo-worker.mjs +2 -2
- package/src/drained-owner.mjs +26 -0
- package/src/drained-slot.mjs +20 -3
- package/src/mcp-outcome.mjs +10 -1
- package/src/mcp-sse.mjs +62 -0
- package/src/pr-head-reviewer.mjs +3 -3
- package/src/process-inspection.mjs +36 -0
- package/src/pull-queue.mjs +159 -0
- package/src/route-setting.mjs +24 -0
- package/src/server.mjs +157 -29
- package/src/service-migrate-workers.mjs +113 -0
- package/src/service.mjs +388 -0
- package/src/setup.mjs +63 -0
- package/src/store.mjs +21 -9
- package/src/tool-registry.mjs +3 -1
- package/src/try-exposure.mjs +908 -0
- package/src/try-hosted-clients.mjs +46 -0
- package/src/try-hosted.mjs +444 -0
- package/src/try-selfcheck.mjs +168 -0
- package/src/try.mjs +63 -17
- package/src/workers.mjs +33 -23
- package/src/workspace.mjs +10 -3
package/bin/dot-worker.mjs
CHANGED
|
@@ -3,7 +3,6 @@ import { defaultPath,workspaceRoot,rootWarnings } from '../src/paths.mjs';
|
|
|
3
3
|
import { readEnv } from '../src/env.mjs';
|
|
4
4
|
import http from 'node:http';
|
|
5
5
|
import net from 'node:net';
|
|
6
|
-
import { execFileSync } from 'node:child_process';
|
|
7
6
|
import { DatabaseSync } from 'node:sqlite';
|
|
8
7
|
import { prepareNodeModules } from '../src/prepared-node-modules.mjs';
|
|
9
8
|
import fs from 'node:fs';
|
|
@@ -18,6 +17,7 @@ import { legacyFixLedgerPath } from '../src/legacy-names.mjs';
|
|
|
18
17
|
import { buildInbox, formatInbox, parseWhen, decideWords } from '../src/inbox.mjs';
|
|
19
18
|
import { decideDrained, drainedExitCodes, terminal } from '../src/drained.mjs';
|
|
20
19
|
import { takeSlot, releaseSlot } from '../src/drained-slot.mjs';
|
|
20
|
+
import { liveWaiter } from '../src/drained-owner.mjs';
|
|
21
21
|
import { resolveHelp } from '../src/cli-help.mjs';
|
|
22
22
|
import { readLines } from '../src/request-log.mjs';
|
|
23
23
|
import { lintChecksFile, formatChecksReport } from '../src/check-lint.mjs';
|
|
@@ -62,7 +62,7 @@ const FIRST_JOB_URL=docsUrl('docs/manual-setup.md','submit-finish-and-read-the-r
|
|
|
62
62
|
const cli=json?'dalan':cliCommand(process.argv[1]);
|
|
63
63
|
// Every option a command reads. An option it does not know is refused, so a typo is not ignored in silence.
|
|
64
64
|
const SUBMIT_FLAGS=['--stdin','--json','--review','--wait','--dry-run','--queue-anyway','--refuse-defer','--allow-scope-prune','--fix-scope','--background','--allow-main','--exclude-sensitive'];
|
|
65
|
-
const SUBMIT_VALUES=['--file','--brief','--worker','--thread','--deliver','--timeout','--execution','--require-capability','--objective-key','--revision','--task-kind','--source','--sensitive-scope-override','--defer-if-queued','--producer-thread'];
|
|
65
|
+
const SUBMIT_VALUES=['--eligible','--policy','--file','--brief','--worker','--thread','--deliver','--timeout','--execution','--require-capability','--objective-key','--revision','--task-kind','--source','--sensitive-scope-override','--defer-if-queued','--producer-thread'];
|
|
66
66
|
const SUBMIT_OPTIONS=[...SUBMIT_FLAGS,...SUBMIT_VALUES];
|
|
67
67
|
function refuseUnknownOptions(name,{flags=[],values=[]}) {
|
|
68
68
|
for(let i=0;i<args.length;i++) {
|
|
@@ -129,12 +129,12 @@ function acpReceipt(id) {
|
|
|
129
129
|
if(secret.length<32) return null;
|
|
130
130
|
return {request_id:id,token:createHmac('sha256',secret).update(id).digest('hex'),acp:true};
|
|
131
131
|
}
|
|
132
|
-
function writeReceipt(id, token, body, delivery, review=false, background=false, meta=null, producer=null) {
|
|
132
|
+
function writeReceipt(id, token, body, delivery, review=false, background=false, meta=null, producer=null, routing=null, destinationRevisions=null) {
|
|
133
133
|
fs.mkdirSync(receipts,{recursive:true,mode:0o700});
|
|
134
134
|
const file=receiptPath(id);
|
|
135
135
|
try {
|
|
136
136
|
const fd=fs.openSync(file,'wx',0o600);
|
|
137
|
-
try { fs.writeSync(fd,JSON.stringify({request_id:id,token,body,delivery,...(delivery.startsWith('t3:')?{thread:delivery.slice(3)}:{}),...(review?{review:true}:{}),...(background?{background:true}:{}),...(meta?{meta}:{}),...(producer?{producer}:{})})+'\n'); fs.fsyncSync(fd); }
|
|
137
|
+
try { fs.writeSync(fd,JSON.stringify({request_id:id,token,body,delivery,...(delivery.startsWith('t3:')?{thread:delivery.slice(3)}:{}),...(review?{review:true}:{}),...(background?{background:true}:{}),...(meta?{meta}:{}),...(producer?{producer}:{}),...(routing?{routing,destination_revisions:destinationRevisions??{}}:{})})+'\n'); fs.fsyncSync(fd); }
|
|
138
138
|
finally { fs.closeSync(fd); }
|
|
139
139
|
} catch(e) { if(e.code!=='EEXIST') throw e; }
|
|
140
140
|
const dir=fs.openSync(receipts,'r'); try { fs.fsyncSync(dir); } finally { fs.closeSync(dir); }
|
|
@@ -208,15 +208,6 @@ function producerId() {
|
|
|
208
208
|
}
|
|
209
209
|
const drainedDir=defaultPath(home,'.local/state/dot-bridge/drained');
|
|
210
210
|
function drainedPidfile(producer) { return path.join(drainedDir,createHash('sha256').update(producer).digest('hex').slice(0,32)+'.json'); }
|
|
211
|
-
function liveWaiter(held) {
|
|
212
|
-
try {
|
|
213
|
-
if(!Number.isSafeInteger(held.pid)||held.pid<=0) return null;
|
|
214
|
-
const cmd=process.platform==='darwin'
|
|
215
|
-
? execFileSync('/bin/ps',['-p',String(held.pid),'-o','command='],{stdio:['ignore','pipe','ignore'],timeout:1000})
|
|
216
|
-
: fs.readFileSync(`/proc/${held.pid}/cmdline`,'utf8');
|
|
217
|
-
return cmd.includes('wait')&&cmd.includes('--drained')?held:null;
|
|
218
|
-
} catch { return null; }
|
|
219
|
-
}
|
|
220
211
|
// Producer receipts. A parsed receipt never changes, so it is read once; one still being written is retried next time.
|
|
221
212
|
function producerReceipts(producer,cache) {
|
|
222
213
|
let names=[]; try { names=fs.readdirSync(receipts); } catch {}
|
|
@@ -309,7 +300,7 @@ async function waitDrained() {
|
|
|
309
300
|
// One waiter per producer: a second one exits at once, so the hook and a forgetful agent cannot stack them.
|
|
310
301
|
fs.mkdirSync(drainedDir,{recursive:true,mode:0o700});
|
|
311
302
|
const file=drainedPidfile(producer), mine={pid:process.pid,token:randomBytes(8).toString('hex'),producer,started_at:new Date().toISOString()};
|
|
312
|
-
const other=takeSlot(file,mine,{isLive:
|
|
303
|
+
const other=takeSlot(file,mine,{isLive:liveWaiter});
|
|
313
304
|
if(other) return {status:'already_running',producer,pid:other.pid,started_at:other.started_at};
|
|
314
305
|
const release=()=>releaseSlot(file,mine);
|
|
315
306
|
process.once('exit',release);
|
|
@@ -421,6 +412,19 @@ async function main() {
|
|
|
421
412
|
if(!Array.isArray(body.inputs)&&!args.includes('--dry-run')) throw jobFix('the job has no inputs array: inputs must be an array', 'add "inputs": [] when the job has no repository input');
|
|
422
413
|
const id=body.request_id, review=args.includes('--review'), background=args.includes('--background'), worker=option('--worker');
|
|
423
414
|
if(args.includes('--worker')&&(!worker||worker.startsWith('--'))) throw new Error('--worker requires a name');
|
|
415
|
+
if(args.includes('--eligible')&&args.includes('--policy'))throw new Error('use either --eligible or --policy');
|
|
416
|
+
let routing=null,destinationRevisions={};
|
|
417
|
+
if(args.includes('--eligible')) {
|
|
418
|
+
const list=option('--eligible');if(!list||list.startsWith('--'))throw new Error('--eligible requires a comma-separated worker list');
|
|
419
|
+
routing={version:1,allowed_workers:list.split(','),fan_out:1,...(body.valid_until?{deadline_at:body.valid_until}:{})};
|
|
420
|
+
}
|
|
421
|
+
if(args.includes('--policy')) {
|
|
422
|
+
const file=option('--policy');if(!file||file.startsWith('--'))throw new Error('--policy requires a JSON file');
|
|
423
|
+
const value=JSON.parse(fs.readFileSync(file,'utf8'));
|
|
424
|
+
if(value?.routing&&Object.keys(value).some(key=>!['routing','destination_revisions'].includes(key)))throw new Error('unsupported policy file field');
|
|
425
|
+
routing=value.routing??value;destinationRevisions=value.destination_revisions??{};
|
|
426
|
+
}
|
|
427
|
+
if(routing&&worker)throw new Error('--worker cannot be combined with --eligible or --policy');
|
|
424
428
|
// Execution capability (none|worker|host) and required backend capabilities travel beside the assignment, like --worker.
|
|
425
429
|
const execution=option('--execution'), requireCaps=option('--require-capability');
|
|
426
430
|
if(args.includes('--execution')) parseExecution(execution);
|
|
@@ -438,25 +442,29 @@ async function main() {
|
|
|
438
442
|
// workers.json, so a stale CLI profile cannot authorize an assignment.
|
|
439
443
|
if(!dryRun&&!fs.existsSync(receiptPath(id))) {
|
|
440
444
|
const policy=loadOwnerWorkers(readEnv('DALAN_WORKERS_FILE')||defaultPath(home,'.config/dot-bridge/workers.json'));
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
if(inputs.
|
|
445
|
-
|
|
445
|
+
const targets=routing?.allowed_workers??[submitTarget(policy,worker??undefined)??'dot'],inputs=body.inputs;
|
|
446
|
+
for(const target of targets) {
|
|
447
|
+
if(routing&&!policy.workers.has(target))throw new Error('unknown eligible worker '+target);
|
|
448
|
+
if(Array.isArray(inputs)&&inputs.some(input=>input?.github_repo!==undefined)) {
|
|
449
|
+
const repoName=inputs[0]?.github_repo;
|
|
450
|
+
if(inputs.length!==1) throw new Error('one repository input per job; submit separate jobs for multiple repositories');
|
|
451
|
+
if(typeof repoName!=='string'||!policy.allowsRepo(target,repoName)) throw new Error(`repository ${typeof repoName==='string'?repoName:'(invalid repository)'} is not allowed for worker "${target}"; update it with dalan worker allow ${target} OWNER/REPO, or choose another worker`);
|
|
452
|
+
}
|
|
446
453
|
}
|
|
447
454
|
}
|
|
448
455
|
const token=randomBytes(32).toString('hex');
|
|
449
|
-
const write=()=>writeReceipt(id,token,JSON.stringify(body),delivery,review,background,{...given,source:given.source??'agent'},producerId());
|
|
456
|
+
const write=()=>writeReceipt(id,token,JSON.stringify(body),delivery,review,background,{...given,source:given.source??'agent'},producerId(),routing,destinationRevisions);
|
|
450
457
|
let saved;
|
|
451
458
|
if(dryRun) {
|
|
452
459
|
try { saved=receipt(id); }
|
|
453
|
-
catch(error) { if(error.code!=='ENOENT') throw error; saved={request_id:id,token,delivery,body:input}; }
|
|
460
|
+
catch(error) { if(error.code!=='ENOENT') throw error; saved={request_id:id,token,delivery,body:input,...(routing?{routing,destination_revisions:destinationRevisions}:{})}; }
|
|
454
461
|
} else saved=write();
|
|
462
|
+
if(!routing&&saved.routing) {routing=saved.routing;destinationRevisions=saved.destination_revisions??{};}
|
|
455
463
|
let fresh=!dryRun&&saved.token===token;
|
|
456
464
|
// Receipts written by earlier releases may carry the old spelling of a source; compare the normalized form.
|
|
457
465
|
const savedMeta=()=>{ try { return normalizeMeta(saved.meta); } catch { return {}; } };
|
|
458
466
|
const conflicts=()=>{ const savedDelivery=saved.delivery ?? (saved.thread ? `t3:${saved.thread}` : null);
|
|
459
|
-
return JSON.stringify(canonical(JSON.parse(saved.body)))!==JSON.stringify(canonical(body))||savedDelivery!==delivery||!!saved.review!==review||!!saved.background!==background||metaFields.some(k=>savedMeta()[k]!=null&&given[k]!==null&&savedMeta()[k]!==given[k]); };
|
|
467
|
+
return JSON.stringify(canonical(saved.routing??null))!==JSON.stringify(canonical(routing))||JSON.stringify(canonical(saved.destination_revisions??{}))!==JSON.stringify(canonical(destinationRevisions))||JSON.stringify(canonical(JSON.parse(saved.body)))!==JSON.stringify(canonical(body))||savedDelivery!==delivery||!!saved.review!==review||!!saved.background!==background||metaFields.some(k=>savedMeta()[k]!=null&&given[k]!==null&&savedMeta()[k]!==given[k]); };
|
|
460
468
|
const conflict=()=>Object.assign(new Error('request_id conflict with local receipt'),{local_code:'receipt_conflict'});
|
|
461
469
|
// A refused submit stores no assignment, so its receipt guards nothing. Replace it instead of refusing a corrected retry.
|
|
462
470
|
if(dryRun&&conflicts()) throw conflict();
|
|
@@ -468,7 +476,7 @@ async function main() {
|
|
|
468
476
|
}
|
|
469
477
|
// A retry inherits what the receipt recorded for any flag it omits, so replaying a drainer request by hand stays one request.
|
|
470
478
|
const meta=Object.fromEntries(metaFields.map(k=>[k,given[k]??savedMeta()[k]??(k==='source'?'agent':null)]));
|
|
471
|
-
const send=()=>request(dryRun?'/submit-preview':'/submit', 'POST', { ...(worker?{worker}:{}), delivery, assignment: body, owner_token:saved.token, review, ...(background?{background:true}:{}), meta, ...(args.includes('--sensitive-scope-override')?{sensitive_scope_override:option('--sensitive-scope-override')}:{}), ...(args.includes('--allow-main')?{allow_main:true}:{}), ...(args.includes('--exclude-sensitive')?{exclude_sensitive:true}:{}), ...(execution?{execution}:{}), ...(requiredCapabilities?{required_capabilities:requiredCapabilities}:{}), ...(dryRun?{dry_run:true}:{...(refuseDefer?{refuse_defer:true}:{}),...(queueAnyway?{queue_anyway:true}:{})}), ...(args.includes('--defer-if-queued')?{defer_queued:Number(option('--defer-if-queued'))}:{}) },args.includes('--allow-main')?{'x-operator-key':operator()}:{});
|
|
479
|
+
const send=()=>request(dryRun?'/submit-preview':'/submit', 'POST', { ...(worker?{worker}:{}), ...(routing?{routing,destination_revisions:destinationRevisions}:{}), delivery, assignment: body, owner_token:saved.token, review, ...(background?{background:true}:{}), meta, ...(args.includes('--sensitive-scope-override')?{sensitive_scope_override:option('--sensitive-scope-override')}:{}), ...(args.includes('--allow-main')?{allow_main:true}:{}), ...(args.includes('--exclude-sensitive')?{exclude_sensitive:true}:{}), ...(execution?{execution}:{}), ...(requiredCapabilities?{required_capabilities:requiredCapabilities}:{}), ...(dryRun?{dry_run:true}:{...(refuseDefer?{refuse_defer:true}:{}),...(queueAnyway?{queue_anyway:true}:{})}), ...(args.includes('--defer-if-queued')?{defer_queued:Number(option('--defer-if-queued'))}:{}) },args.includes('--allow-main')?{'x-operator-key':operator()}:{});
|
|
472
480
|
try {
|
|
473
481
|
try { result=await send(); }
|
|
474
482
|
catch(error) {
|
|
@@ -651,15 +659,16 @@ async function main() {
|
|
|
651
659
|
// Built-in authorization server. init writes local files only (no running bridge needed); connect talks to the owner socket.
|
|
652
660
|
case 'init': case 'as-init': {
|
|
653
661
|
const publicUrl=option('--public-url'), legacy=args.includes('--legacy'), name=option('--worker'), profiled=command==='init';
|
|
654
|
-
const flagged=['--json','--public-url','--worker','--legacy'];
|
|
655
|
-
const usage='usage: dalan init --public-url https://HOST (--worker NAME | --legacy)';
|
|
662
|
+
const flagged=['--json','--public-url','--worker','--legacy','--enable-workspace'];
|
|
663
|
+
const usage='usage: dalan init --public-url https://HOST (--worker NAME [--enable-workspace] | --legacy)';
|
|
656
664
|
if(!publicUrl||args.some((a,i)=>!flagged.includes(a)&&!['--public-url','--worker'].includes(args[i-1]))||(!profiled&&(legacy||name))) throw new Error(profiled?usage:'usage: dalan as-init --public-url https://HOST');
|
|
665
|
+
if(args.includes('--enable-workspace')&&(!profiled||legacy)) throw new Error('--enable-workspace requires init --worker NAME');
|
|
657
666
|
if(profiled&&legacy&&name) throw new Error('init takes --worker NAME or --legacy, not both');
|
|
658
667
|
if(profiled&&!legacy&&(!name||name.startsWith('--'))) throw new Error(`init needs --worker NAME to create the first worker profile (or --legacy for an older single-worker host); ${usage}`);
|
|
659
668
|
const config=defaultPath(home,'.config/dot-bridge'), workersFile=path.join(config,'workers.json');
|
|
660
669
|
if(profiled&&!legacy) { parseWorkers({workers:{[name]:{}}},{builtin:true}); if(fs.existsSync(workersFile)) throw new Error(`${workersFile} already exists; init does not overwrite a worker profile`); }
|
|
661
670
|
result=initAsFiles(config,{publicUrl,loopback:readEnv('DALAN_LOOPBACK')==='1',allowHttp:process.env.NODE_ENV!=='production'&&readEnv('DALAN_TEST_OAUTH')==='1'});
|
|
662
|
-
if(profiled&&!legacy) result={...result,workers_profile:{file:writeGenericProfile(workersFile,name),worker:name,default_execution:'none'}};
|
|
671
|
+
if(profiled&&!legacy) result={...result,workers_profile:{file:writeGenericProfile(workersFile,name,{workspaceAllowed:args.includes('--enable-workspace')}),worker:name,default_execution:'none'}};
|
|
663
672
|
else if(profiled) { writeLegacyMarker(config); result={...result,workers_profile:null,legacy_profile:path.join(config,'legacy-profile')}; console.error('dalan: --legacy wrote no workers.json; it wrote a legacy-profile marker so the server starts in legacy mode. Legacy mode (implicit default worker, t3 capability, host execution) is for older single-worker hosts; new hosts should use --worker NAME.'); }
|
|
664
673
|
break;
|
|
665
674
|
}
|
|
@@ -16,13 +16,13 @@ The owner completes the setup and first-job checks below on the intended account
|
|
|
16
16
|
|
|
17
17
|
**Do not paste a callback template.** OpenAI directs operators to copy the exact production redirect URI from the MCP server's management page. Current documentation distinguishes callback-ID-specific `https://chatgpt.com/connector/oauth/{callback_id}` from stable `https://chatgpt.com/connector_platform_oauth_redirect`; stable selection depends on issuer-identification support, with an older-server exception. This recipe does not assume which mode the pinned bridge will select. [Redirect rules](https://developers.openai.com/plugins/build/auth#redirect-url)
|
|
18
18
|
|
|
19
|
-
The same source documents protected-resource discovery, DCR through `registration_endpoint`, and CIMD as a different client-identity path. DCR registers a client; CIMD does not. A predefined/static OAuth client instead requires an already registered ID and matching client-authentication method. A static client secret is not a bearer token. [OAuth/client registration](https://developers.openai.com/plugins/build/auth#oauth-flow)
|
|
19
|
+
The same source documents protected-resource discovery, Dynamic Client Registration (DCR) through `registration_endpoint`, and Client ID Metadata Documents (CIMD) as a different client-identity path. DCR registers a client; CIMD does not. A predefined/static OAuth client instead requires an already registered ID and matching client-authentication method. A static client secret is not a bearer token. [OAuth/client registration](https://developers.openai.com/plugins/build/auth#oauth-flow)
|
|
20
20
|
|
|
21
21
|
For this built-in recipe, use DCR only if offered and compatible. This recipe covers Dynamic Client Registration; other registration methods need separate instructions from the owner. Do not invent credentials, switch issuers, add headers, or modify discovery/auth policy. If only another method is available, stop and ask the owner for that separately validated path.
|
|
22
22
|
|
|
23
23
|
Owner sequence:
|
|
24
24
|
|
|
25
|
-
1.
|
|
25
|
+
1. For a normal first connection, follow [Connect ChatGPT](connect-chatgpt.md). Fresh initialization includes the documented ChatGPT callback patterns. If you need to add a callback to an existing installation, obtain the complete redirect from ChatGPT's connection settings or current official instructions before adding it. If you cannot establish the exact value, stop rather than guessing.
|
|
26
26
|
2. Verify HTTPS, exact vendor host and full path, including any connection-specific suffix. The bridge refuses callback queries, fragments and credentials. The `as_registration_refused` log records no callback details; it is not a callback source. [Bridge callback handling](https://github.com/tnunamak/dalan/blob/main/scripts/live-trial/README.md#4-pair-fixture-a-and-allow-its-callback)
|
|
27
27
|
3. On the bridge host, allow that value **before DCR**, then open the short pairing window:
|
|
28
28
|
|
|
@@ -56,7 +56,7 @@ dalan connect approve CODE --worker NAME
|
|
|
56
56
|
|
|
57
57
|
These are bridge pairing requirements, not vendor UI claims. A missing/mismatched code, unexpected scopes or expired window is a stop, not permission to approve an entry without code comparison over a trusted channel. [Bridge pairing flow](https://github.com/tnunamak/dalan/blob/main/scripts/live-trial/README.md#4-pair-fixture-a-and-allow-its-callback)
|
|
58
58
|
|
|
59
|
-
Before a job, inspect the actual connected catalog. The text smoke needs `list_pending`, `get`, `claim`, `progress` and `finish`; `ack_message` is useful only for messages.
|
|
59
|
+
Before a job, inspect the actual connected catalog. The text smoke needs `list_pending`, `get`, `claim`, `progress` and `finish`; `ack_message` is useful only for messages. With the global T3 switch off, a modern process catalog omits `t3_thread_*` and advertises `notify_owner` to every worker; a worker without `t3` must still receive a denied result if it calls that tool. Advertised names do not grant authority. Repository tools, if enabled on the existing host, are not needed and must not be called by this execution-none job. Missing tools or unexpected privilege are blockers, not reasons to expand the profile.
|
|
60
60
|
|
|
61
61
|
For stale schemas, OpenAI documents refreshing the connection and retesting in a new conversation. [Metadata refresh](https://developers.openai.com/plugins/deploy/connect-chatgpt#refresh-metadata) Verify that the refreshed tool catalog exposes optional `acquisition_id`. Do not infer that every client needs, or never needs, a new conversation. Inspect the live `claim` schema and record what actually refreshed; any new Work/Codex task needs its own required authorization.
|
|
62
62
|
|
|
@@ -87,7 +87,7 @@ dalan submit --worker NAME --execution none --file first-job.json
|
|
|
87
87
|
dalan get REQUEST_ID --json
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
Use the `request_id` from the submit response for `REQUEST_ID`. Save the JSON and that ID; if the response is lost, retry the identical file/ID, not a new job. Confirm `execution` is `none` and the intended target worker before continuing.
|
|
90
|
+
Use the `request_id` from the submit response for `REQUEST_ID`. Save the JSON and that ID; if the response is lost, retry the identical file/ID, not a new job. Confirm `execution` is `none` and the intended target worker before continuing.
|
|
91
91
|
|
|
92
92
|
Manually ask the already authorized cloud conversation to do exactly this (replace `REQUEST_ID` with the confirmed ID and explicitly select the connected bridge):
|
|
93
93
|
|
|
@@ -101,7 +101,7 @@ After the worker finishes, the owner reads the bridge record, not just the chat
|
|
|
101
101
|
dalan get REQUEST_ID --json
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
Confirm that the job's status is `finished` and its report outcome is `completed`. Check the intended worker, execution `none` and the exact `SMOKE` value from `first-job.json`. A chat answer without the matching bridge report is not completion. After reviewing the report, run `dalan decide REQUEST_ID accepted`. Stop after this one job; repository work and recurring runs need their own setup.
|
|
105
105
|
|
|
106
106
|
## 5. Limits and owner acceptance record
|
|
107
107
|
|
|
@@ -10,7 +10,7 @@ The owner completes the setup and first-job checks below on the intended account
|
|
|
10
10
|
|
|
11
11
|
- Confirm that this account/workspace can add or use a custom remote MCP connector, perform OAuth, enable it in a conversation, and call the required tools. On managed plans, organization role and connector access matter; the official help page describes owner setup before member connection. A plan label alone is not an access test. [Custom connector setup](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp)
|
|
12
12
|
- Unattended execution and background-worker availability are separate observations. An interactive manual smoke proves neither. If a required connector control is absent, stop and have the owner verify access; do not upgrade, change roles, or add a subscription.
|
|
13
|
-
-
|
|
13
|
+
- Complete [service setup](service-setup.md#owner-setup), put `dalan` on your PATH, and export `DALAN_HOME` to the generated service home. Use a dedicated worker with no T3 capability and no allowed repositories for this first job. `NAME` below means that worker's profile name, not the account display name.
|
|
14
14
|
- Supply the public **HTTPS resource URL** from the private `<bridge-home>/resource-url` file, including its secret path and `/mcp`. Do not use the origin, an OAuth endpoint or localhost. Claude's remote connector traffic originates from Anthropic infrastructure, even when the UI is on a local device. [Network requirements](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp#network-requirements)
|
|
15
15
|
- Prefer public HTTPS port 443 as a simple trial default, not an asserted Claude port restriction. Have the owner verify path-suffixed resource/authorization discovery (200), tokenless MCP (401), and unsuffixed discovery/root/`/admin` (404) from outside the private network. The [public-surface checker](https://github.com/tnunamak/dalan/blob/main/scripts/live-trial/README.md#3-verify-from-outside-the-tailnet) consumes a private resource-file value; do not reuse an unrelated example job.
|
|
16
16
|
|
|
@@ -31,7 +31,7 @@ dalan connect allow-callback 'https://claude.ai/api/mcp/auth_callback'
|
|
|
31
31
|
dalan connect start --worker NAME
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
The current custom-connector UI distinguishes automatic registration, published
|
|
34
|
+
The current custom-connector UI distinguishes automatic registration, a published Client ID Metadata Document (CIMD), and a supplied OAuth client. Choose **Register automatically** for this Dynamic Client Registration (DCR) recipe, not the published-identity default simply because it is recommended in the UI. [Connector setup](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp)
|
|
35
35
|
|
|
36
36
|
DCR discovers `registration_endpoint` and creates the client. A static OAuth client requires the owner to register the exact redirect first and supply the matching client ID/authentication credentials; it is not a static request-header token. CIMD is another identity method, not DCR. [Claude authentication](https://claude.com/docs/connectors/building/authentication#register-claude-as-an-oauth-client)
|
|
37
37
|
|
|
@@ -59,7 +59,7 @@ These are bridge requirements. A code mismatch, expired window or unexpected cal
|
|
|
59
59
|
|
|
60
60
|
Anthropic's test guide says to verify connected state, review **Tool permissions**, then enable the connector from **+ → Connectors** in a chat and confirm an actual tool call. [Test guide](https://claude.com/docs/connectors/building/testing#test-in-claude-as-a-custom-connector)
|
|
61
61
|
|
|
62
|
-
For this smoke, require `list_pending`, `get`, `claim`, `progress` and `finish`; `ack_message` is only for messages.
|
|
62
|
+
For this smoke, require `list_pending`, `get`, `claim`, `progress` and `finish`; `ack_message` is only for messages. With global T3 tools disabled, the process-wide catalog omits `t3_thread_*` and still advertises `notify_owner`; the worker's missing `t3` capability must make a direct `notify_owner` call fail. Advertised names do not grant authority. Repository tools may depend on existing host configuration, but are unnecessary and must not be called for the execution-none job. Verify the actual `claim` schema, including optional `acquisition_id`, instead of importing ChatGPT's refresh behavior. Missing tools or excess privileges are owner blockers; do not expand policy.
|
|
63
63
|
|
|
64
64
|
## 4. One owner-submitted text smoke
|
|
65
65
|
|
|
@@ -88,7 +88,7 @@ dalan submit --worker NAME --execution none --file first-job.json
|
|
|
88
88
|
dalan get REQUEST_ID --json
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
Use the `request_id` from the submit response for `REQUEST_ID`. Save the JSON and that ID; if the response is lost, retry the identical file/ID, not a new job. Confirm `execution` is `none` and the intended target worker before continuing.
|
|
91
|
+
Use the `request_id` from the submit response for `REQUEST_ID`. Save the JSON and that ID; if the response is lost, retry the identical file/ID, not a new job. Confirm `execution` is `none` and the intended target worker before continuing.
|
|
92
92
|
|
|
93
93
|
Manually ask the already authorized cloud conversation to do exactly this (replace `REQUEST_ID` with the confirmed ID and explicitly select the connected bridge):
|
|
94
94
|
|
|
@@ -102,7 +102,7 @@ After the worker finishes, the owner reads the bridge record, not just the chat
|
|
|
102
102
|
dalan get REQUEST_ID --json
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
Confirm that the job's status is `finished` and its report outcome is `completed`. Check the intended worker, execution `none` and the exact `SMOKE` value from `first-job.json`. A chat answer without the matching bridge report is not completion. After reviewing the report, run `dalan decide REQUEST_ID accepted`. Stop after this one job; repository work and recurring runs need their own setup.
|
|
106
106
|
|
|
107
107
|
## 5. Limits and owner acceptance record
|
|
108
108
|
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Send a job from Codex CLI to Muse Spark
|
|
2
|
+
|
|
3
|
+
Codex CLI submits a job through a local `dalan mcp` process. Muse Spark, Meta's hosted chat client, connects to the bridge over HTTPS and returns a report. You read it and record an accept or reject decision. The bridge queues work; you start the worker in Muse Spark.
|
|
4
|
+
|
|
5
|
+
## What you need
|
|
6
|
+
|
|
7
|
+
- Linux with systemd user services, or macOS with launchd.
|
|
8
|
+
- Node.js 24 or newer and npm.
|
|
9
|
+
- Codex CLI installed and signed in on the bridge computer.
|
|
10
|
+
- A Muse Spark account with remote MCP connections and tool calls available.
|
|
11
|
+
- A public HTTPS address that Muse Spark can reach. This guide creates one with Tailscale Funnel. Install Tailscale, sign in, and enable MagicDNS, HTTPS certificates and Funnel for the machine first. On macOS, use the open-source `tailscaled`; the App Store and Standalone apps do not support Funnel.
|
|
12
|
+
- A free local port, here `8799`, and a new, short bridge-home path on local disk.
|
|
13
|
+
|
|
14
|
+
Funnel makes the bridge reachable from the public internet. Its HTTPS certificate publishes the machine and tailnet DNS names in a public certificate ledger. Keep the full MCP URL private: its path contains a secret. Your Codex and Muse Spark accounts retain their own usage limits and charges.
|
|
15
|
+
|
|
16
|
+
This first job uses no repository and runs no checks. Use a dedicated worker named `muse`. Do not reuse another worker's connection.
|
|
17
|
+
|
|
18
|
+
## 1. Start and expose the bridge
|
|
19
|
+
|
|
20
|
+
On the bridge computer, install Dalan:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install -g @tnunamak/dalan
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Create and start the service. The example home must not already exist. If the port is occupied, choose another free port.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
node "$(npm root -g)/@tnunamak/dalan/scripts/worker-bridge-setup.mjs" \
|
|
30
|
+
--worker muse --port 8799 --home "$HOME/.local/share/dalan-muse" \
|
|
31
|
+
--expose tailscale --no-repo-tools --start
|
|
32
|
+
export DALAN_HOME="$HOME/.local/share/dalan-muse"
|
|
33
|
+
dalan status --json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Use the same `DALAN_HOME` in every owner shell below. The setup writes a service and a private `resource-url` file in that home. It disables repository workspace tools for this example. A new worker has no repository grants.
|
|
37
|
+
|
|
38
|
+
Open `$DALAN_HOME/resource-url` privately and use its entire URL in step 2. Do not substitute the public hostname alone or a loopback URL. If you already have an HTTPS reverse proxy, use the [service guide](service-setup.md) instead of setting up a second exposure.
|
|
39
|
+
|
|
40
|
+
**Check:** setup prints `Resource URL file (private, mode 0600):` followed by the file path, and `PASS public HTTPS: GET /admin returned 404 from the bridge`. The status command returns a JSON status record. The public check proves reachability, not that Muse Spark has finished a job.
|
|
41
|
+
|
|
42
|
+
## 2. Connect Muse Spark as the worker
|
|
43
|
+
|
|
44
|
+
The bridge ships this exact Meta callback in its default allow-list:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
https://agent.meta.ai/api/hatch/oauth/callback
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Start a pairing window:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
dalan connect start --worker muse
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
In Muse Spark, add a remote MCP server with the complete URL from `resource-url`. Start its OAuth sign-in and leave the Dalan sign-in page open. These are general actions, not names of Muse Spark controls.
|
|
57
|
+
|
|
58
|
+
On the bridge computer:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
dalan connect pending
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Compare the code with the one in your browser. Check that the worker is `muse`, the redirect is the Meta callback above and the resource identifies your bridge. Check the scopes: ordinary jobs need `dalan.read` and `dalan.work`. The older `dot-bridge.read` and `dot-bridge.work` names are aliases. The bridge also advertises `t3.read` and `t3.write`; those names do not replace the Dalan job scopes. Do not approve an unexpected connection or rely on its client name, which the app supplies.
|
|
65
|
+
|
|
66
|
+
Replace `CODE` with your matching pending code:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
dalan connect approve CODE --worker muse
|
|
70
|
+
dalan connect list
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Complete the sign-in in the browser and return to Muse Spark. Do not add `--replace` to resolve a conflict casually: it transfers this worker's queued and future jobs to the new connection.
|
|
74
|
+
|
|
75
|
+
**Check:** approval prints `Approved "CODE" for worker "muse".` with your actual code. The connection list contains worker `muse` with `revoked_at: null`. Ask Muse Spark to list pending Dalan jobs; a successful reply, even an empty list, confirms tool access.
|
|
76
|
+
|
|
77
|
+
## 3. Add the local requester to Codex
|
|
78
|
+
|
|
79
|
+
Codex uses standard input and output, not the public worker URL. Find the installed executable in the owner shell:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
command -v dalan
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Add this entry to `~/.codex/config.toml`. Replace both paths with absolute paths from your computer. Do not leave `~` or `$HOME` in the example values.
|
|
86
|
+
|
|
87
|
+
```toml
|
|
88
|
+
[mcp_servers.dalan]
|
|
89
|
+
command = "/absolute/path/to/dalan"
|
|
90
|
+
args = ["mcp"]
|
|
91
|
+
env = { DALAN_HOME = "/absolute/path/to/.local/share/dalan-muse" }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Start a new Codex CLI session on this computer so it loads the entry. Ask it to call `dalan_status`. To call these tools from `codex exec`, which has no screen to approve them, set per-tool approval for the `dalan` server as the `codex exec` paragraph of [Worker clients](worker-clients.md#native-cli-worker-codex-cli) describes.
|
|
95
|
+
|
|
96
|
+
The local server has the access of the Unix user running it. It uses the bridge's admin socket and needs no separate OAuth connection. Give it only to an agent you trust with your local Dalan CLI access.
|
|
97
|
+
|
|
98
|
+
**Check:** Codex exposes `dalan_submit`, `dalan_wait`, `dalan_result` and `dalan_status`. The status call returns your bridge's JSON status rather than a connection error.
|
|
99
|
+
|
|
100
|
+
## 4. Send one small job and read the result
|
|
101
|
+
|
|
102
|
+
Ask Codex to call `dalan_submit` with this object. Replace the request ID with a fresh `req_` plus UUID for each new job; keep the same ID when retrying that same submission.
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"worker": "muse",
|
|
107
|
+
"execution": "none",
|
|
108
|
+
"assignment": {
|
|
109
|
+
"schema_version": 1,
|
|
110
|
+
"request_id": "req_REPLACE_WITH_NEW_UUID",
|
|
111
|
+
"brief": "Write one sentence explaining why a finished job still needs owner review. Do not read files, run commands or call external services other than Dalan job tools.",
|
|
112
|
+
"inputs": [],
|
|
113
|
+
"expected_output": "One plain-text sentence.",
|
|
114
|
+
"execution_scope": "read-only"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Read the returned verdict and request ID. If the tool returns an error with reasons, fix the submission before proceeding. A queued job does not launch Muse Spark. In your Muse Spark conversation, send this instruction with the returned ID:
|
|
120
|
+
|
|
121
|
+
> Request REQUEST_ID is your only job: claim it with Dalan, do what its brief asks, report progress and finish it with the claim_id. Stop if it is missing or cancelled. Claim no other job.
|
|
122
|
+
|
|
123
|
+
Allow the job tool calls in Muse Spark. Back in Codex, ask it to call `dalan_wait` with `{"request_id":"REQUEST_ID","timeout_seconds":120}`, then `dalan_result` with `{"request_id":"REQUEST_ID"}`.
|
|
124
|
+
|
|
125
|
+
A wait can stop for a question, blocker or cancellation as well as a result. Read the state. If it reports `timeout`, the job remains open; inspect it and wait again. The local tool defaults to 120 seconds and caps each wait at 300 seconds. This route defaults to no external result delivery, so read the result here.
|
|
126
|
+
|
|
127
|
+
**Check:** `dalan_result` returns `status: "finished"` and a report containing the sentence. Read the report's outcome and content; a finished state alone does not establish success or acceptance.
|
|
128
|
+
|
|
129
|
+
## 5. Accept or reject the result
|
|
130
|
+
|
|
131
|
+
The local MCP server has no decision tool. In your owner shell, with the same `DALAN_HOME`, replace `REQUEST_ID` and choose one command.
|
|
132
|
+
|
|
133
|
+
Accept a satisfactory answer:
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
dalan decide REQUEST_ID accepted --json
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Reject an answer that is not useful:
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
dalan decide REQUEST_ID not_useful --json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Do not use `rejected`: it is not a supported decision word. This records your review; it does not apply a patch or merge code.
|
|
146
|
+
|
|
147
|
+
**Check:** the command succeeds and returns the recorded decision in its JSON response.
|
|
148
|
+
|
|
149
|
+
## Troubleshooting
|
|
150
|
+
|
|
151
|
+
- **Public DNS or HTTPS check fails.** Setup prints `FAIL public DNS:` or `FAIL public HTTPS:`. Read its suggested next step. The service and home remain in place; use the printed retry-check command after fixing the issue, rather than rerunning setup against the same home.
|
|
152
|
+
- **The sign-in page says `Not accepting connections` or `Connection attempt invalid or expired`.** Open a new pairing window with `dalan connect start --worker muse`, restart sign-in in Muse Spark, and compare the new code with `dalan connect pending`.
|
|
153
|
+
- **The callback is refused.** The bridge can report `Callback not allowed` or refuse registration because the redirect does not match an allowed callback. Obtain the exact current callback from Muse Spark's connection flow or provider documentation. Verify that it belongs to the client before allowing it with `dalan connect allow-callback 'EXACT_HTTPS_CALLBACK'`, then restart sign-in. Do not broaden the allow-list to an entire domain.
|
|
154
|
+
- **Codex cannot reach the bridge.** A CLI error beginning `cannot reach the bridge:` means the selected home's bridge is not running. Check the absolute `DALAN_HOME` in the Codex entry, then run `dalan status --json` in an owner shell with that same home and inspect the service. Do not register the public URL as Codex's requester endpoint.
|
|
155
|
+
- **Approval says the worker already has an active connection.** Inspect `dalan connect list`. Continue with the existing intended Muse Spark connection, or deliberately revoke it before pairing again. Do not approve a different client just because it calls itself Muse Spark.
|
|
156
|
+
|
|
157
|
+
## Removal
|
|
158
|
+
|
|
159
|
+
First disconnect the worker while the bridge is running:
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
dalan connect revoke muse
|
|
163
|
+
dalan connect stop
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Remove the remote MCP server from Muse Spark. Remove only the `mcp_servers.dalan` entry you added to Codex's configuration and start a new Codex session.
|
|
167
|
+
|
|
168
|
+
To remove this dedicated service and its recorded Funnel exposure:
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
node "$(npm root -g)/@tnunamak/dalan/scripts/worker-bridge-setup.mjs" \
|
|
172
|
+
--remove --worker muse --home "$HOME/.local/share/dalan-muse"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
This command retains the bridge home, including its keys and job history. Follow [service removal](service-setup.md#remove-a-generated-service) if you also want to delete that data.
|
package/docs/connect-chatgpt.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This guide takes you from a built-in OAuth connection to one completed job. Use ChatGPT on the web with custom MCP connections enabled for your account or workspace; UI labels can vary. The owner runs Dalan and approves the connection; the ChatGPT user connects the worker and starts its run. One person can perform both roles.
|
|
4
4
|
|
|
5
|
+
**Just trying it?** Follow the [README hosted trial](../README.md#quickstart). It prints the connector URL and steps for a short hosted demo, then returns the agent's report to your terminal. The rest of this guide sets up a permanent bridge.
|
|
6
|
+
|
|
5
7
|
## Owner setup
|
|
6
8
|
|
|
7
9
|
1. Follow the [service setup](service-setup.md) with a publicly reachable HTTPS origin. Set `DALAN_HOME` to that service's private home and make `dalan` available on your PATH with the [manual setup](manual-setup.md#owner-and-requester-setup) steps. Use the service's worker name wherever this guide says `NAME`.
|
|
@@ -21,10 +23,13 @@ This guide takes you from a built-in OAuth connection to one completed job. Use
|
|
|
21
23
|
The response shows an open window for `NAME`; the default is ten minutes. Fresh init already allows `https://chatgpt.com/connector_platform_oauth_redirect` and the callback-ID form `https://chatgpt.com/connector/oauth/*`. An existing installation retains its saved allowlist. If its attempt uses the exact callback observed below and that callback is absent, add it before retrying.
|
|
22
24
|
|
|
23
25
|
```sh
|
|
24
|
-
|
|
26
|
+
printf 'Exact ChatGPT callback shown for this connection: '
|
|
27
|
+
IFS= read -r CALLBACK_URL
|
|
28
|
+
dalan connect allow-callback "$CALLBACK_URL"
|
|
29
|
+
unset CALLBACK_URL
|
|
25
30
|
```
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
Compare the complete value with ChatGPT's displayed redirect before running the command. Add only that verified callback, then restart the connection flow.
|
|
28
33
|
|
|
29
34
|
## ChatGPT user setup
|
|
30
35
|
|
|
@@ -38,7 +43,7 @@ This guide takes you from a built-in OAuth connection to one completed job. Use
|
|
|
38
43
|
dalan connect pending
|
|
39
44
|
```
|
|
40
45
|
|
|
41
|
-
Match the code on the browser page, worker `NAME`, resource, client ID, callback and requested scopes.
|
|
46
|
+
Match the code on the browser page, worker `NAME`, resource, client ID, callback and requested scopes. The client name is untrusted text. Compare the callback with the exact redirect shown by ChatGPT for this connection; it may be the stable redirect or a callback-ID-specific redirect described in [Resolve the exact callback](chatgpt-worker-onboarding.md#2-resolve-the-exact-callback-before-registration). If attempts are ambiguous or a value differs unexpectedly, resolve that before approval.
|
|
42
47
|
|
|
43
48
|
```sh
|
|
44
49
|
dalan connect approve CODE --worker NAME
|
|
@@ -69,7 +74,7 @@ This guide takes you from a built-in OAuth connection to one completed job. Use
|
|
|
69
74
|
|
|
70
75
|
## When connection fails
|
|
71
76
|
|
|
72
|
-
If ChatGPT says “Couldn't discover OAuth settings” or “Some app settings were rejected,” inspect discovery, registration, tunnel and TLS stages rather than assuming a single cause. OpenAI does not document a universal port requirement for public custom MCP endpoints. See its [connection guide](https://developers.openai.com/plugins/deploy/connect-chatgpt) and [OAuth guide](https://developers.openai.com/plugins/build/auth).
|
|
77
|
+
If ChatGPT says “Couldn't discover OAuth settings” or “Some app settings were rejected,” first check that the bridge is running (`dalan status --json` in the service's Home) and that ChatGPT has the complete HTTPS MCP URL, then inspect the discovery, registration, tunnel and TLS stages rather than assuming a single cause. Do not change authentication to get past the error. OpenAI does not document a universal port requirement for public custom MCP endpoints. See its [connection guide](https://developers.openai.com/plugins/deploy/connect-chatgpt) and [OAuth guide](https://developers.openai.com/plugins/build/auth).
|
|
73
78
|
|
|
74
79
|
HTTP 421 means the incoming Host does not match the configured public origin, including any non-default port. Preserve Host through the proxy; forwarding a different `X-Forwarded-Host` does not fix it. See [network setup](service-setup.md).
|
|
75
80
|
|
|
@@ -28,7 +28,13 @@ The bridge reports observations and labels, not diagnoses. `dalan status --json`
|
|
|
28
28
|
| `alive_not_claiming` | the worker called tools recently, slots free, item still queued after 2x the interval | interval 10 min (`assignment_reannounce_interval_ms`) |
|
|
29
29
|
| `transport_failing` | no event for the item ever got a 2xx; separate path, no re-announce | 20 min (`pause_suspected_silence_ms`) |
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
**Recover a claim.** Run `dalan claims` to inspect active grants. Automatic abandonment happens after the persisted lease expires; a usage break does not extend it. Regrant still requires verified host stop and resolved delivery/admission gates. `dalan abandon ID` needs the operator key and does not shorten the old deadline or prove that remote compute stopped. See [Claims and leases](operations.md#claims-and-leases).
|
|
32
|
+
|
|
33
|
+
**After a restart.** A claim last touched before startup is not swept until startup plus that claim's own lease duration. A claim touched since startup gets no restart grace. The first maintenance tick after the applicable deadline performs the sweep. Native protocol claims require explicit `renew_claim`; ordinary activity does not extend their fixed deadline.
|
|
34
|
+
|
|
35
|
+
**Queued work.** Preparation expiry and default-worker skip expiry continue during pause or a usage break. The PR-head reviewer cancels work for merged or closed PRs. See [Jobs the worker never takes](pull-workers.md#jobs-the-worker-never-takes) and [PR-head reviewer](pr-head-reviewer.md).
|
|
36
|
+
|
|
37
|
+
**Alerts and wake-ups.** The liveness classes above are observations, not proof of a cause. Attention alerts require 30 continuous observed minutes before publication; a recovery notice follows only an alert that was sent. `denial_mentioned` is log-only. Queue re-wakes are normally limited to one event per subscription every 90 seconds, with older work backing off after two hours. Pause, full capacity, inactive subscriptions and unresolved delivery can suppress them. For exact eligibility, settings and terminal transport behavior, see [Lifecycle events and metrics](operations.md#lifecycle-events-and-metrics).
|
|
32
38
|
|
|
33
39
|
## Change and rollback
|
|
34
40
|
|