openclaw-code-agent 4.7.2 → 4.7.3

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/README.md CHANGED
@@ -128,7 +128,7 @@ Because worktree isolation defaults to `delegate`, `defaultWorkdir` should norma
128
128
 
129
129
  Chat-launched sessions route updates back to their originating chat thread. For agent-launched tool sessions without an origin route, configure `fallbackChannel` or `agentChannels` in the reference guide.
130
130
 
131
- The current package targets and validates against OpenClaw `2026.7.1`, which is also the minimum host version advertised for new installs. The plugin API peer range remains `>=2026.4.21` for dependency resolution, while the install requirement stays aligned with the host version used for release verification. OpenClaw `2026.7.1` changes Codex app-server, Telegram delivery, cron/session delivery, tool visibility, approval, and plugin update behavior, but `openclaw-code-agent` does not need new SDK imports for those changes: the manifest already declares `contracts.tools`, the plugin still imports only `openclaw/plugin-sdk/plugin-entry`, and its own session store, wake routing, callbacks, worktree flows, and harness model restrictions remain plugin-owned. Current callback behavior around native callback data, routed follow-ups, retryable stale plan approval buttons, and serialized plan decisions remains plugin-owned.
131
+ The current package targets, validates against, and requires OpenClaw `2026.7.1`. Its install, plugin API, Gateway, and peer dependency metadata all use that same minimum so OpenClaw and ClawHub reject older hosts before installation. OpenClaw `2026.7.1` changes Codex app-server, Telegram delivery, cron/session delivery, tool visibility, approval, and plugin update behavior, but `openclaw-code-agent` does not need new SDK imports for those changes: the manifest already declares `contracts.tools`, the plugin still imports only `openclaw/plugin-sdk/plugin-entry`, and its own session store, wake routing, callbacks, worktree flows, and harness model restrictions remain plugin-owned. Current callback behavior around native callback data, routed follow-ups, retryable stale plan approval buttons, and serialized plan decisions remains plugin-owned.
132
132
 
133
133
  If you use Codex, make sure the local `codex` command or `OPENCLAW_CODEX_APP_SERVER_COMMAND` override is available and authenticated. Codex-specific defaults live under `harnesses.codex`: `reasoningEffort` is sent as `reasoningEffort`, and `fastMode: true` sends `service_tier: "fast"` on Codex App Server thread, resume, and turn payloads. The Codex harness starts the app server with stdio listener args by default, only sends UUID-shaped backend thread IDs to `thread/resume`, and reports startup timeouts with redacted recent stderr. When Codex auth is inconsistent, this is the recommended `~/.codex/config.toml` setting:
134
134
 
package/dist/index.js CHANGED
@@ -54,7 +54,7 @@ What would you like to do?
54
54
 
55
55
  (This tool cannot automatically reopen or recreate PRs to avoid unintended actions.)`}],meta:{success:!1,state:"closed"}};{if(w?.policy==="never-pr")return{content:[{type:"text",text:`Error: Repo policy forbids PR creation for ${w.identity?.repoRoot??d}.`}],meta:{success:!1,state:"error"}};let R=!r.title||!r.body?He(d,u,f):void 0,_;if(!r.title||!r.body){let Q=await Fn({sessionName:l,branchName:u,prompt:o.prompt,outputPreview:o.outputPreview,diffSummary:R,provider:p});if(Q.ok===!1)return{content:[{type:"text",text:`❌ ${Q.error}`}],meta:{success:!1,state:"error"}};_=Q.metadata}let F=r.title??_.title,N=r.body;N||(N=qn({sessionName:l,metadata:_,diffSummary:R}));let B=ol(d,u,f,F,N,m,{draft:!0});if(B.success&&B.prUrl){let Q=be(d,u,m);k({prUrl:B.prUrl,prNumber:Q.number,targetRepo:m,disposition:"pr-opened"});let Y=bt({kind:"pr-opened",branch:u,targetRepo:m,prUrl:B.prUrl});return v.notifyWorktreeOutcome(o.notificationTarget,Y,{completionWakeOutcomeKey:Ws({action:"opened",branchName:u,prUrl:B.prUrl,prNumber:Q.number,targetRepo:m}),detailLines:Ns({action:"opened",branchName:u,baseBranch:f,prUrl:B.prUrl,prNumber:Q.number,targetRepo:m})}),{content:[{type:"text",text:B.warnings&&B.warnings.length>0?`${Y}
56
56
 
57
- ⚠️ ${B.warnings.join("; ")}`:Y}],meta:{success:!0,state:"created"}}}else return{content:[{type:"text",text:`❌ Failed to create PR: ${B.error??"unknown error"}`}],meta:{success:!1,state:"error"}}}}}}}var So=J(()=>{se();V();Re();Es();Dn();Nn();Es()});import{readdirSync as dv,statSync as lv,rmSync as uv}from"fs";import{execFileSync as cv}from"child_process";import{join as ya}from"path";var va={name:"openclaw-code-agent",version:"4.7.2",type:"module",packageManager:"pnpm@10.30.0",main:"dist/index.js",scripts:{"audit:prod":"pnpm audit --prod",build:"esbuild index.ts --bundle --platform=node --target=node22 --format=esm --outfile=dist/index.js --minify --charset=utf8 --pure:console.log --pure:console.warn --pure:console.info --pure:console.debug --external:@anthropic-ai/claude-agent-sdk --external:openclaw/plugin-sdk/plugin-entry","check-static-guardrails":"node scripts/check-static-guardrails.mjs","check-plugin-security":"node scripts/check-plugin-security.mjs",test:"node scripts/run-tests.mjs","test:integ:crabbox":"node scripts/run-tests.mjs tests/oca-codex-crabbox-integ.test.ts tests/oca-plugin-workflows-integ.test.ts tests/oca-codex-telegram-proof.test.ts tests/oca-codex-proof-app-server.test.ts tests/oca-codex-proof-workflow.test.ts","test:serial":"node scripts/run-tests.mjs","test:file":"node scripts/run-tests.mjs","smoke:backend":"node scripts/run-tests.mjs tests/codex-harness.test.ts tests/plan-mode-e2e.test.ts tests/session-restore-service.test.ts","smoke:backend-parity":"node scripts/run-tests.mjs tests/backend-contract-smoke.test.ts tests/codex-harness.test.ts tests/harness-registry.test.ts","smoke:codex-worktrees":"node scripts/run-tests.mjs tests/codex-harness.test.ts tests/session-bootstrap.test.ts tests/session-restore-service.test.ts","smoke:codex-live":"OPENCLAW_RUN_LIVE_CODEX_SMOKE=1 node scripts/run-tests.mjs tests/live-codex-app-server-smoke.test.ts","proof:codex-doctor":"node --import tsx scripts/e2e/oca-codex-telegram-proof.ts doctor","proof:codex-local":"node --import tsx scripts/e2e/oca-codex-telegram-proof.ts local-smoke","proof:codex-telegram":"node scripts/e2e/run-oca-codex-telegram-proof.mjs","smoke:codex-release":"OPENCLAW_RUN_LIVE_CODEX_RELEASE_SMOKE=1 node scripts/run-tests.mjs tests/live-codex-app-server-smoke.test.ts","smoke:opencode-live":"OPENCLAW_RUN_LIVE_OPENCODE_SMOKE=1 node scripts/run-tests.mjs tests/live-opencode-server-smoke.test.ts",typecheck:"tsc -p tsconfig.typecheck.json --noEmit","validate:release-metadata":"node scripts/validate-release-metadata.mjs",verify:"pnpm check-static-guardrails && pnpm typecheck && pnpm build && pnpm test"},openclaw:{extensions:["./dist/index.js"],install:{npmSpec:"openclaw-code-agent",defaultChoice:"npm",minHostVersion:">=2026.7.1"},compat:{pluginApi:">=2026.4.21",minGatewayVersion:"2026.4.21"},build:{openclawVersion:"2026.7.1",pluginSdkVersion:"2026.7.1"}},files:["dist/","skills/","openclaw.plugin.json","README.md","LICENSE"],dependencies:{"@anthropic-ai/claude-agent-sdk":"^0.3.142"},devDependencies:{"@types/node":"^26.0.1",esbuild:"^0.28.1",nanoid:"^5.1.7",openclaw:"2026.7.1",tsx:"^4.21.0",typescript:"^6.0.2"},keywords:["openclaw","plugin","claude","claude-code","opencode","coding-agent","codex","ai","anthropic","agent","code-generation","automation","cli","background-process","developer-tools"],repository:{type:"git",url:"git+https://github.com/goldmar/openclaw-code-agent.git"},homepage:"https://github.com/goldmar/openclaw-code-agent#readme",bugs:{url:"https://github.com/goldmar/openclaw-code-agent/issues"},license:"MIT",author:"Mark Goldenstein",publishConfig:{access:"public",provenance:!0},description:"An OpenClaw plugin that orchestrates coding agent sessions as managed background processes. Launch, monitor, and control coding agents (Claude Code, Codex, experimental OpenCode, and more) directly from your AI gateway.",peerDependencies:{openclaw:">=2026.4.21"},overrides:{"basic-ftp":"5.3.1","fast-xml-builder@<1.1.7":"1.1.7","ip-address@<10.1.1":"10.1.1"}};import{execFile as Ip}from"node:child_process";import{mkdirSync as xp,readFileSync as Tp,renameSync as Cp,writeFileSync as Mp}from"node:fs";import{dirname as _p,join as $p}from"node:path";import{promisify as Ep}from"node:util";import*as Ma from"child_process";import{createHash as Yc}from"crypto";var re="code-agent";var Zc=new Set(["1","true","yes","on"]);function wi(){let t=process.env.OPENCLAW_CODE_AGENT_BUTTON_DIAGNOSTICS?.trim().toLowerCase();return!!(t&&Zc.has(t))}function Ie(t){if(!(typeof t!="string"||t.length===0))return Yc("sha256").update(t).digest("hex").slice(0,12)}function wa(t){return typeof t.callbackData=="string"?t.callbackData:typeof t.value=="string"?t.value:void 0}function X(t){let e=(t??[]).filter(r=>Array.isArray(r)&&r.length>0),n=e.flat();return{buttonRows:e.length||void 0,buttonCount:n.length||void 0,buttonLabels:n.length>0?n.map(r=>typeof r.label=="string"?r.label:void 0):void 0,callbackByteLengths:n.length>0?n.map(r=>{let o=wa(r);return o?Buffer.byteLength(o,"utf8"):void 0}):void 0,callbackHashes:n.length>0?n.map(r=>Ie(wa(r))):void 0,buttonStyles:n.length>0?n.map(r=>typeof r.style=="string"?r.style:void 0):void 0}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function ba(t){let e=et(t),n=Array.isArray(e?.blocks)?e.blocks:void 0;if(n)return n.map(r=>et(r)?.type).filter(r=>typeof r=="string"&&r.length>0)}function Ra(t){let e=et(t),n=Array.isArray(e?.blocks)?e.blocks:void 0;if(!n)return;let r=n.map(o=>{let i=et(o);return i?.type!=="buttons"||!Array.isArray(i.buttons)?[]:i.buttons}).filter(o=>o.length>0);return r.length>0?r:void 0}function Pi(t){let e=Ra(t);return{presentationBlockTypes:ba(t),...X(e)}}function bi(t){let e=et(t),n=e?.interactive,r=et(e?.channelData),o=et(r?.telegram),i=Array.isArray(o?.buttons)?o.buttons:void 0;return{renderedPayloadKeys:e?Object.keys(e).sort():void 0,interactiveBlockTypes:ba(n),...Pa("interactive",X(Ra(n))),...Pa("telegramChannelData",X(i)),hasPresentation:!!e?.presentation,hasInteractive:!!n,hasTelegramChannelDataButtons:!!i?.some(s=>s.length>0)}}function Aa(t){let e=et(t);return e?{sendResultKeys:Object.keys(e).sort(),messageId:vi(e.messageId),chatId:vi(e.chatId),telegramThreadId:vi(e.messageThreadId??e.threadId),channel:typeof e.channel=="string"?e.channel:void 0}:{sendResultType:typeof t}}function vi(t){return typeof t=="string"||typeof t=="number"?t:void 0}function Pa(t,e){let n={};for(let[r,o]of Object.entries(e))o!==void 0&&(n[`${t}${r.charAt(0).toUpperCase()}${r.slice(1)}`]=o);return n}function U(t,e){if(!wi())return;let n=Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));`${JSON.stringify({event:t,callbackNamespace:re,...n})}`}ft();var Ta=5e3,_a=64,Xc={primary:"primary",success:"success",positive:"success",danger:"danger",destructive:"danger",negative:"danger"},ep={execFile:Ma.execFile},nt=class extends Error{constructor(e){super(e),this.name="MissingRuntimeDirectNotificationCapabilityError"}},Dt=class{constructor(e=ep.execFile){this.execFile=e}execFile;async send(e,n,r){U("direct_send_started",{...xe(e),messageTextLength:n.length,...X(r)});try{await this.sendViaRuntime(e,n,r),U("direct_send_succeeded",{...xe(e),deliveryPath:"runtime",...X(r)});return}catch(o){if(!(o instanceof nt))throw U("direct_send_failed",{...xe(e),deliveryPath:"runtime",...X(r),error:Ai(o)}),o;U("direct_send_runtime_capability_missing",{...xe(e),deliveryPath:"runtime",...X(r),reason:o.message}),await this.sendViaBoundedCliFallback(e,n,r,o.message),U("direct_send_succeeded",{...xe(e),deliveryPath:"cli-fallback",...X(r)})}}async sendViaRuntime(e,n,r){let o=tt(),i=xa(),s=o?.channel?.outbound?.loadAdapter;if(!o)throw new nt("OpenClaw plugin runtime is unavailable for direct notification delivery");if(i==null)throw new nt("OpenClaw runtime config snapshot is unavailable for direct notification delivery");if(!o.channel)throw new nt(`OpenClaw plugin runtime channel surface is unavailable for direct notification delivery (runtimeVersion=${Ii(o)})`);if(!o.channel.outbound)throw new nt(`OpenClaw plugin runtime channel outbound surface is unavailable for direct notification delivery (runtimeVersion=${Ii(o)})`);if(!s)throw new nt(`OpenClaw plugin runtime channel outbound loadAdapter is unavailable for direct notification delivery (runtimeVersion=${Ii(o)})`);let a=await s(e.channel);if(!a)throw new Error(`OpenClaw outbound adapter for channel "${e.channel}" is unavailable`);let d=er(r);if(U("runtime_adapter_loaded",{...xe(e),adapterHasRenderPresentation:typeof a.renderPresentation=="function",adapterHasSendPayload:typeof a.sendPayload=="function",adapterHasSendText:typeof a.sendText=="function",...X(r),...d?Pi(d):{}}),d){await this.sendPresentation(a,i,e,n,d);return}if(!a.sendText)throw new Error(`OpenClaw outbound adapter for channel "${e.channel}" cannot send text`);await a.sendText({cfg:i,to:e.target,text:n,accountId:e.accountId,threadId:e.threadId})}async sendPresentation(e,n,r,o,i){let s=np(i),a={text:o,presentation:i,interactive:s};U("presentation_render_started",{...xe(r),messageTextLength:o.length,adapterHasRenderPresentation:typeof e.renderPresentation=="function",adapterHasSendPayload:typeof e.sendPayload=="function",...Pi(i)});let d={cfg:n,to:r.target,text:o,payload:a,accountId:r.accountId,threadId:r.threadId},l=e.renderPresentation?await e.renderPresentation({payload:a,presentation:i,ctx:d}):a,u=op(l,s,r.channel);if(U("presentation_render_completed",{...xe(r),adapterHasRenderPresentation:typeof e.renderPresentation=="function",adapterHasSendPayload:typeof e.sendPayload=="function",...bi(u)}),!u||typeof u!="object"||!e.sendPayload)throw new Error(`OpenClaw outbound adapter for channel "${r.channel}" cannot preserve interactive presentation`);let f=await e.sendPayload({...d,payload:u});U("presentation_send_payload_completed",{...xe(r),...bi(u),...Aa(f)})}sendViaBoundedCliFallback(e,n,r,o){return new Promise((i,s)=>{let a=tp(e,n,r);U("direct_send_cli_fallback_started",{...xe(e),deliveryPath:"cli-fallback",reason:o,messageTextLength:n.length,...X(r)}),this.execFile("openclaw",a,{timeout:Ta,killSignal:"SIGKILL"},(d,l,u)=>{if(!d){U("direct_send_cli_fallback_completed",{...xe(e),deliveryPath:"cli-fallback",...X(r)}),i();return}let f=u?.trim()?` | stderr: ${u.trim()}`:"";U("direct_send_cli_fallback_failed",{...xe(e),deliveryPath:"cli-fallback",...X(r),error:Ai(d),stderrLength:u?.length}),s(new Error(`${o}; bounded openclaw message send fallback failed within ${Ta}ms timeout: ${Ai(d)}${f}`))})})}};function xe(t){return{channel:t.channel,target:t.target,accountId:t.accountId,threadId:t.threadId,sessionKey:t.sessionKey}}function tp(t,e,n){let r=er(n),o=["message","send","--channel",t.channel,"--target",t.target,"--message",e];return t.accountId&&o.push("--account",t.accountId),t.threadId&&o.push("--thread-id",t.threadId),r&&o.push("--presentation",JSON.stringify(r)),o}function Ai(t){return t instanceof Error?t.message:String(t)}function Ii(t){if(!t||typeof t!="object")return"unknown";let e=t.version;return typeof e=="string"&&e.trim()?e:"unknown"}function er(t){let e=(t??[]).filter(n=>Array.isArray(n)&&n.length>0).map(n=>({type:"buttons",buttons:n.map(r=>({label:r.label,value:up(r.callbackData),...r.style?{style:r.style}:{}}))}));return e.length>0?{blocks:e}:void 0}function np(t){let e=t.blocks.filter(n=>n.type==="buttons"&&n.buttons.length>0).map(n=>({type:"buttons",buttons:n.buttons.map(r=>({label:r.label,value:r.value,...r.style?{style:r.style}:{}}))}));return e.length>0?{blocks:e}:void 0}function rp(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t.interactive;if(!e||typeof e!="object"||Array.isArray(e))return!1;let n=e.blocks;return Array.isArray(n)&&n.some(r=>{if(!r||typeof r!="object"||Array.isArray(r))return!1;let o=r;return o.type==="buttons"&&Array.isArray(o.buttons)&&o.buttons.length>0})}function op(t,e,n){if(!e)return t;let r=rp(t)?t:ip(t,e);return n!=="telegram"?r:sp(r,e)}function ip(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:{...t,interactive:e}}function sp(t,e){if(!t||typeof t!="object"||Array.isArray(t))return t;let n=t,r=Ot(n.channelData),o=Ot(r?.telegram),i=dp(o?.buttons);if(i)return{...n,channelData:{...r??{},telegram:{...o??{},buttons:i}}};let s=ap(e);return s?{...n,channelData:{...r??{},telegram:{...o??{},buttons:s}}}:t}function ap(t){let e=t.blocks.filter(n=>n.type==="buttons"&&n.buttons.length>0).map(n=>n.buttons.filter(r=>typeof r.value=="string"&&r.value.trim().length>0&&Buffer.byteLength(r.value,"utf8")<=_a).map(r=>({text:r.label,callback_data:r.value,...$a(r.style)}))).filter(n=>n.length>0);return e.length>0?e:void 0}function dp(t){if(!Array.isArray(t))return;let e=t.map(n=>Array.isArray(n)?n.map(r=>{if(!r||typeof r!="object"||Array.isArray(r))return;let{style:o,...i}=r;if(!(typeof i.text!="string"||i.text.trim().length===0)&&!(i.callback_data!==void 0&&(typeof i.callback_data!="string"||i.callback_data.trim().length===0||Buffer.byteLength(i.callback_data,"utf8")>_a))&&lp(i))return{...i,...$a(o)}}).filter(r=>!!r):[]).filter(n=>n.length>0);return e.length>0?e:void 0}function lp(t){return Xn(t.callback_data)||Xn(t.url)||Zn(t.web_app)||Zn(t.webApp)||Zn(t.login_url)||Zn(t.loginUrl)||typeof t.switch_inline_query=="string"||typeof t.switch_inline_query_current_chat=="string"||Ot(t.switch_inline_query_chosen_chat)!==void 0||Ot(t.callback_game)!==void 0||t.pay===!0||Ca(t.copy_text)||Ca(t.copyText)}function Xn(t){return typeof t=="string"&&t.trim().length>0}function Zn(t){let e=Ot(t);return Xn(e?.url)}function Ca(t){let e=Ot(t);return Xn(e?.text)}function $a(t){if(typeof t!="string")return{};let e=t.trim().toLowerCase(),n=Xc[e];return n?{style:n}:{}}function Ot(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function up(t){return t.startsWith(`${re}:`)?t:`${re}:${t}`}ae();ye();var Dp=Ep(Ip),Ni="openclaw-code-agent",Op=`https://registry.npmjs.org/${encodeURIComponent(Ni)}/latest`,Np="openclaw-code-agent-auto-update.json",qa=1440*60*1e3,Wp=7*qa,Lp=1e4,Bt="plugin:auto-update";function Ua(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Oi(t){return t instanceof Error?t.message:String(t)}function ht(t){return t?.trim().replace(/^v/i,"")||void 0}function Wi(t){let n=ht(t)?.match(/^((?:0|[1-9]\d*))\.((?:0|[1-9]\d*))\.((?:0|[1-9]\d*))$/);if(!n?.[1]||!n[2]||!n[3])return;let r=[Number(n[1]),Number(n[2]),Number(n[3])];return r.every(Number.isSafeInteger)?r:void 0}function Bp(t,e){let n=Wi(t),r=Wi(e);if(!n||!r)return!1;for(let o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]<r[o])return!1}return!1}function Fp(t){if(!Ua(t))return{};let e={};for(let n of["lastCheckedAt","latestVersion","promptedVersion","lastPromptedAt","dismissedVersion","lastDismissedAt","updateInstalledVersion","restartPromptedVersion","lastError"]){let r=t[n];typeof r=="string"&&r.trim()&&(e[n]=r)}return e}function Ba(t){if(!(!t?.provider||!t.target||t.provider==="system"||t.target==="system"))return{channel:t.provider,target:t.target,accountId:t.accountId,threadId:t.threadId,sessionKey:t.sessionKey}}function Fa(){if(D.fallbackChannel)return _e(D.fallbackChannel)}async function qp(){let t=await fetch(Op,{headers:{accept:"application/json"},signal:AbortSignal.timeout(Lp)});if(!t.ok)throw new Error(`npm registry returned HTTP ${t.status}`);let e=await t.json(),n=Ua(e)&&typeof e.version=="string"?ht(e.version):void 0;return n?{version:n}:void 0}async function Up(t,e){let n=await Dp(t,e,{timeout:12e4,maxBuffer:1048576});return{stdout:n.stdout?.toString()??"",stderr:n.stderr?.toString()??""}}var rr=class{constructor(e){this.options=e;this.statePath=$p(e.stateDir,Np),this.notifier=e.notifier??new Dt,this.fetchLatestRelease=e.fetchLatestRelease??qp,this.runCommand=e.runCommand??Up,this.now=e.now??Date.now}options;statePath;notifier;fetchLatestRelease;runCommand;now;checkInFlight;maybeCheckForUpdate(e={}){this.checkInFlight||(this.checkInFlight=this.checkForUpdate(e).catch(n=>{`${Oi(n)}`}).finally(()=>{this.checkInFlight=void 0}))}async waitForIdle(){await this.checkInFlight}async installConfirmed(e,n){let r=ht(e);if(!r||!Wi(r))return"Could not determine which stable OCA version to update to.";await this.runCommand("openclaw",["plugins","update",`${Ni}@${r}`]);let o=this.readState();this.writeState({...o,updateInstalledVersion:r});let i=Ba(n?.route??Fa());if(i)try{return await this.sendRestartPrompt(i,r),`OCA update command completed for ${r}. Restart confirmation was sent.`}catch(s){`${r}${Oi(s)}`}return[`OCA update command completed for ${r}.`,"Restart the Gateway explicitly to load it: openclaw gateway restart"].join(`
57
+ ⚠️ ${B.warnings.join("; ")}`:Y}],meta:{success:!0,state:"created"}}}else return{content:[{type:"text",text:`❌ Failed to create PR: ${B.error??"unknown error"}`}],meta:{success:!1,state:"error"}}}}}}}var So=J(()=>{se();V();Re();Es();Dn();Nn();Es()});import{readdirSync as dv,statSync as lv,rmSync as uv}from"fs";import{execFileSync as cv}from"child_process";import{join as ya}from"path";var va={name:"openclaw-code-agent",version:"4.7.3",type:"module",packageManager:"pnpm@10.30.0",main:"dist/index.js",scripts:{"audit:prod":"pnpm audit --prod",build:"esbuild index.ts --bundle --platform=node --target=node22 --format=esm --outfile=dist/index.js --minify --charset=utf8 --pure:console.log --pure:console.warn --pure:console.info --pure:console.debug --external:@anthropic-ai/claude-agent-sdk --external:openclaw/plugin-sdk/plugin-entry","check-static-guardrails":"node scripts/check-static-guardrails.mjs","check-plugin-security":"node scripts/check-plugin-security.mjs",test:"node scripts/run-tests.mjs","test:integ:crabbox":"node scripts/run-tests.mjs tests/oca-codex-crabbox-integ.test.ts tests/oca-plugin-workflows-integ.test.ts tests/oca-codex-telegram-proof.test.ts tests/oca-codex-proof-app-server.test.ts tests/oca-codex-proof-workflow.test.ts","test:serial":"node scripts/run-tests.mjs","test:file":"node scripts/run-tests.mjs","smoke:backend":"node scripts/run-tests.mjs tests/codex-harness.test.ts tests/plan-mode-e2e.test.ts tests/session-restore-service.test.ts","smoke:backend-parity":"node scripts/run-tests.mjs tests/backend-contract-smoke.test.ts tests/codex-harness.test.ts tests/harness-registry.test.ts","smoke:codex-worktrees":"node scripts/run-tests.mjs tests/codex-harness.test.ts tests/session-bootstrap.test.ts tests/session-restore-service.test.ts","smoke:codex-live":"OPENCLAW_RUN_LIVE_CODEX_SMOKE=1 node scripts/run-tests.mjs tests/live-codex-app-server-smoke.test.ts","proof:codex-doctor":"node --import tsx scripts/e2e/oca-codex-telegram-proof.ts doctor","proof:codex-local":"node --import tsx scripts/e2e/oca-codex-telegram-proof.ts local-smoke","proof:codex-telegram":"node scripts/e2e/run-oca-codex-telegram-proof.mjs","smoke:codex-release":"OPENCLAW_RUN_LIVE_CODEX_RELEASE_SMOKE=1 node scripts/run-tests.mjs tests/live-codex-app-server-smoke.test.ts","smoke:opencode-live":"OPENCLAW_RUN_LIVE_OPENCODE_SMOKE=1 node scripts/run-tests.mjs tests/live-opencode-server-smoke.test.ts",typecheck:"tsc -p tsconfig.typecheck.json --noEmit","validate:release-metadata":"node scripts/validate-release-metadata.mjs",verify:"pnpm check-static-guardrails && pnpm typecheck && pnpm build && pnpm test"},openclaw:{extensions:["./dist/index.js"],install:{npmSpec:"openclaw-code-agent",defaultChoice:"npm",minHostVersion:">=2026.7.1"},compat:{pluginApi:">=2026.7.1",minGatewayVersion:"2026.7.1"},build:{openclawVersion:"2026.7.1",pluginSdkVersion:"2026.7.1"}},files:["dist/","skills/","openclaw.plugin.json","README.md","LICENSE"],dependencies:{"@anthropic-ai/claude-agent-sdk":"^0.3.142"},devDependencies:{"@types/node":"^26.0.1",esbuild:"^0.28.1",nanoid:"^5.1.7",openclaw:"2026.7.1",tsx:"^4.21.0",typescript:"^6.0.2"},keywords:["openclaw","plugin","claude","claude-code","opencode","coding-agent","codex","ai","anthropic","agent","code-generation","automation","cli","background-process","developer-tools"],repository:{type:"git",url:"git+https://github.com/goldmar/openclaw-code-agent.git"},homepage:"https://github.com/goldmar/openclaw-code-agent#readme",bugs:{url:"https://github.com/goldmar/openclaw-code-agent/issues"},license:"MIT",author:"Mark Goldenstein",publishConfig:{access:"public",provenance:!0},description:"An OpenClaw plugin that orchestrates coding agent sessions as managed background processes. Launch, monitor, and control coding agents (Claude Code, Codex, experimental OpenCode, and more) directly from your AI gateway.",peerDependencies:{openclaw:">=2026.7.1"},overrides:{"basic-ftp":"5.3.1","fast-xml-builder@<1.1.7":"1.1.7","ip-address@<10.1.1":"10.1.1"}};import{execFile as Ip}from"node:child_process";import{mkdirSync as xp,readFileSync as Tp,renameSync as Cp,writeFileSync as Mp}from"node:fs";import{dirname as _p,join as $p}from"node:path";import{promisify as Ep}from"node:util";import*as Ma from"child_process";import{createHash as Yc}from"crypto";var re="code-agent";var Zc=new Set(["1","true","yes","on"]);function wi(){let t=process.env.OPENCLAW_CODE_AGENT_BUTTON_DIAGNOSTICS?.trim().toLowerCase();return!!(t&&Zc.has(t))}function Ie(t){if(!(typeof t!="string"||t.length===0))return Yc("sha256").update(t).digest("hex").slice(0,12)}function wa(t){return typeof t.callbackData=="string"?t.callbackData:typeof t.value=="string"?t.value:void 0}function X(t){let e=(t??[]).filter(r=>Array.isArray(r)&&r.length>0),n=e.flat();return{buttonRows:e.length||void 0,buttonCount:n.length||void 0,buttonLabels:n.length>0?n.map(r=>typeof r.label=="string"?r.label:void 0):void 0,callbackByteLengths:n.length>0?n.map(r=>{let o=wa(r);return o?Buffer.byteLength(o,"utf8"):void 0}):void 0,callbackHashes:n.length>0?n.map(r=>Ie(wa(r))):void 0,buttonStyles:n.length>0?n.map(r=>typeof r.style=="string"?r.style:void 0):void 0}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function ba(t){let e=et(t),n=Array.isArray(e?.blocks)?e.blocks:void 0;if(n)return n.map(r=>et(r)?.type).filter(r=>typeof r=="string"&&r.length>0)}function Ra(t){let e=et(t),n=Array.isArray(e?.blocks)?e.blocks:void 0;if(!n)return;let r=n.map(o=>{let i=et(o);return i?.type!=="buttons"||!Array.isArray(i.buttons)?[]:i.buttons}).filter(o=>o.length>0);return r.length>0?r:void 0}function Pi(t){let e=Ra(t);return{presentationBlockTypes:ba(t),...X(e)}}function bi(t){let e=et(t),n=e?.interactive,r=et(e?.channelData),o=et(r?.telegram),i=Array.isArray(o?.buttons)?o.buttons:void 0;return{renderedPayloadKeys:e?Object.keys(e).sort():void 0,interactiveBlockTypes:ba(n),...Pa("interactive",X(Ra(n))),...Pa("telegramChannelData",X(i)),hasPresentation:!!e?.presentation,hasInteractive:!!n,hasTelegramChannelDataButtons:!!i?.some(s=>s.length>0)}}function Aa(t){let e=et(t);return e?{sendResultKeys:Object.keys(e).sort(),messageId:vi(e.messageId),chatId:vi(e.chatId),telegramThreadId:vi(e.messageThreadId??e.threadId),channel:typeof e.channel=="string"?e.channel:void 0}:{sendResultType:typeof t}}function vi(t){return typeof t=="string"||typeof t=="number"?t:void 0}function Pa(t,e){let n={};for(let[r,o]of Object.entries(e))o!==void 0&&(n[`${t}${r.charAt(0).toUpperCase()}${r.slice(1)}`]=o);return n}function U(t,e){if(!wi())return;let n=Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));`${JSON.stringify({event:t,callbackNamespace:re,...n})}`}ft();var Ta=5e3,_a=64,Xc={primary:"primary",success:"success",positive:"success",danger:"danger",destructive:"danger",negative:"danger"},ep={execFile:Ma.execFile},nt=class extends Error{constructor(e){super(e),this.name="MissingRuntimeDirectNotificationCapabilityError"}},Dt=class{constructor(e=ep.execFile){this.execFile=e}execFile;async send(e,n,r){U("direct_send_started",{...xe(e),messageTextLength:n.length,...X(r)});try{await this.sendViaRuntime(e,n,r),U("direct_send_succeeded",{...xe(e),deliveryPath:"runtime",...X(r)});return}catch(o){if(!(o instanceof nt))throw U("direct_send_failed",{...xe(e),deliveryPath:"runtime",...X(r),error:Ai(o)}),o;U("direct_send_runtime_capability_missing",{...xe(e),deliveryPath:"runtime",...X(r),reason:o.message}),await this.sendViaBoundedCliFallback(e,n,r,o.message),U("direct_send_succeeded",{...xe(e),deliveryPath:"cli-fallback",...X(r)})}}async sendViaRuntime(e,n,r){let o=tt(),i=xa(),s=o?.channel?.outbound?.loadAdapter;if(!o)throw new nt("OpenClaw plugin runtime is unavailable for direct notification delivery");if(i==null)throw new nt("OpenClaw runtime config snapshot is unavailable for direct notification delivery");if(!o.channel)throw new nt(`OpenClaw plugin runtime channel surface is unavailable for direct notification delivery (runtimeVersion=${Ii(o)})`);if(!o.channel.outbound)throw new nt(`OpenClaw plugin runtime channel outbound surface is unavailable for direct notification delivery (runtimeVersion=${Ii(o)})`);if(!s)throw new nt(`OpenClaw plugin runtime channel outbound loadAdapter is unavailable for direct notification delivery (runtimeVersion=${Ii(o)})`);let a=await s(e.channel);if(!a)throw new Error(`OpenClaw outbound adapter for channel "${e.channel}" is unavailable`);let d=er(r);if(U("runtime_adapter_loaded",{...xe(e),adapterHasRenderPresentation:typeof a.renderPresentation=="function",adapterHasSendPayload:typeof a.sendPayload=="function",adapterHasSendText:typeof a.sendText=="function",...X(r),...d?Pi(d):{}}),d){await this.sendPresentation(a,i,e,n,d);return}if(!a.sendText)throw new Error(`OpenClaw outbound adapter for channel "${e.channel}" cannot send text`);await a.sendText({cfg:i,to:e.target,text:n,accountId:e.accountId,threadId:e.threadId})}async sendPresentation(e,n,r,o,i){let s=np(i),a={text:o,presentation:i,interactive:s};U("presentation_render_started",{...xe(r),messageTextLength:o.length,adapterHasRenderPresentation:typeof e.renderPresentation=="function",adapterHasSendPayload:typeof e.sendPayload=="function",...Pi(i)});let d={cfg:n,to:r.target,text:o,payload:a,accountId:r.accountId,threadId:r.threadId},l=e.renderPresentation?await e.renderPresentation({payload:a,presentation:i,ctx:d}):a,u=op(l,s,r.channel);if(U("presentation_render_completed",{...xe(r),adapterHasRenderPresentation:typeof e.renderPresentation=="function",adapterHasSendPayload:typeof e.sendPayload=="function",...bi(u)}),!u||typeof u!="object"||!e.sendPayload)throw new Error(`OpenClaw outbound adapter for channel "${r.channel}" cannot preserve interactive presentation`);let f=await e.sendPayload({...d,payload:u});U("presentation_send_payload_completed",{...xe(r),...bi(u),...Aa(f)})}sendViaBoundedCliFallback(e,n,r,o){return new Promise((i,s)=>{let a=tp(e,n,r);U("direct_send_cli_fallback_started",{...xe(e),deliveryPath:"cli-fallback",reason:o,messageTextLength:n.length,...X(r)}),this.execFile("openclaw",a,{timeout:Ta,killSignal:"SIGKILL"},(d,l,u)=>{if(!d){U("direct_send_cli_fallback_completed",{...xe(e),deliveryPath:"cli-fallback",...X(r)}),i();return}let f=u?.trim()?` | stderr: ${u.trim()}`:"";U("direct_send_cli_fallback_failed",{...xe(e),deliveryPath:"cli-fallback",...X(r),error:Ai(d),stderrLength:u?.length}),s(new Error(`${o}; bounded openclaw message send fallback failed within ${Ta}ms timeout: ${Ai(d)}${f}`))})})}};function xe(t){return{channel:t.channel,target:t.target,accountId:t.accountId,threadId:t.threadId,sessionKey:t.sessionKey}}function tp(t,e,n){let r=er(n),o=["message","send","--channel",t.channel,"--target",t.target,"--message",e];return t.accountId&&o.push("--account",t.accountId),t.threadId&&o.push("--thread-id",t.threadId),r&&o.push("--presentation",JSON.stringify(r)),o}function Ai(t){return t instanceof Error?t.message:String(t)}function Ii(t){if(!t||typeof t!="object")return"unknown";let e=t.version;return typeof e=="string"&&e.trim()?e:"unknown"}function er(t){let e=(t??[]).filter(n=>Array.isArray(n)&&n.length>0).map(n=>({type:"buttons",buttons:n.map(r=>({label:r.label,value:up(r.callbackData),...r.style?{style:r.style}:{}}))}));return e.length>0?{blocks:e}:void 0}function np(t){let e=t.blocks.filter(n=>n.type==="buttons"&&n.buttons.length>0).map(n=>({type:"buttons",buttons:n.buttons.map(r=>({label:r.label,value:r.value,...r.style?{style:r.style}:{}}))}));return e.length>0?{blocks:e}:void 0}function rp(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t.interactive;if(!e||typeof e!="object"||Array.isArray(e))return!1;let n=e.blocks;return Array.isArray(n)&&n.some(r=>{if(!r||typeof r!="object"||Array.isArray(r))return!1;let o=r;return o.type==="buttons"&&Array.isArray(o.buttons)&&o.buttons.length>0})}function op(t,e,n){if(!e)return t;let r=rp(t)?t:ip(t,e);return n!=="telegram"?r:sp(r,e)}function ip(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:{...t,interactive:e}}function sp(t,e){if(!t||typeof t!="object"||Array.isArray(t))return t;let n=t,r=Ot(n.channelData),o=Ot(r?.telegram),i=dp(o?.buttons);if(i)return{...n,channelData:{...r??{},telegram:{...o??{},buttons:i}}};let s=ap(e);return s?{...n,channelData:{...r??{},telegram:{...o??{},buttons:s}}}:t}function ap(t){let e=t.blocks.filter(n=>n.type==="buttons"&&n.buttons.length>0).map(n=>n.buttons.filter(r=>typeof r.value=="string"&&r.value.trim().length>0&&Buffer.byteLength(r.value,"utf8")<=_a).map(r=>({text:r.label,callback_data:r.value,...$a(r.style)}))).filter(n=>n.length>0);return e.length>0?e:void 0}function dp(t){if(!Array.isArray(t))return;let e=t.map(n=>Array.isArray(n)?n.map(r=>{if(!r||typeof r!="object"||Array.isArray(r))return;let{style:o,...i}=r;if(!(typeof i.text!="string"||i.text.trim().length===0)&&!(i.callback_data!==void 0&&(typeof i.callback_data!="string"||i.callback_data.trim().length===0||Buffer.byteLength(i.callback_data,"utf8")>_a))&&lp(i))return{...i,...$a(o)}}).filter(r=>!!r):[]).filter(n=>n.length>0);return e.length>0?e:void 0}function lp(t){return Xn(t.callback_data)||Xn(t.url)||Zn(t.web_app)||Zn(t.webApp)||Zn(t.login_url)||Zn(t.loginUrl)||typeof t.switch_inline_query=="string"||typeof t.switch_inline_query_current_chat=="string"||Ot(t.switch_inline_query_chosen_chat)!==void 0||Ot(t.callback_game)!==void 0||t.pay===!0||Ca(t.copy_text)||Ca(t.copyText)}function Xn(t){return typeof t=="string"&&t.trim().length>0}function Zn(t){let e=Ot(t);return Xn(e?.url)}function Ca(t){let e=Ot(t);return Xn(e?.text)}function $a(t){if(typeof t!="string")return{};let e=t.trim().toLowerCase(),n=Xc[e];return n?{style:n}:{}}function Ot(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function up(t){return t.startsWith(`${re}:`)?t:`${re}:${t}`}ae();ye();var Dp=Ep(Ip),Ni="openclaw-code-agent",Op=`https://registry.npmjs.org/${encodeURIComponent(Ni)}/latest`,Np="openclaw-code-agent-auto-update.json",qa=1440*60*1e3,Wp=7*qa,Lp=1e4,Bt="plugin:auto-update";function Ua(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Oi(t){return t instanceof Error?t.message:String(t)}function ht(t){return t?.trim().replace(/^v/i,"")||void 0}function Wi(t){let n=ht(t)?.match(/^((?:0|[1-9]\d*))\.((?:0|[1-9]\d*))\.((?:0|[1-9]\d*))$/);if(!n?.[1]||!n[2]||!n[3])return;let r=[Number(n[1]),Number(n[2]),Number(n[3])];return r.every(Number.isSafeInteger)?r:void 0}function Bp(t,e){let n=Wi(t),r=Wi(e);if(!n||!r)return!1;for(let o=0;o<3;o+=1){if(n[o]>r[o])return!0;if(n[o]<r[o])return!1}return!1}function Fp(t){if(!Ua(t))return{};let e={};for(let n of["lastCheckedAt","latestVersion","promptedVersion","lastPromptedAt","dismissedVersion","lastDismissedAt","updateInstalledVersion","restartPromptedVersion","lastError"]){let r=t[n];typeof r=="string"&&r.trim()&&(e[n]=r)}return e}function Ba(t){if(!(!t?.provider||!t.target||t.provider==="system"||t.target==="system"))return{channel:t.provider,target:t.target,accountId:t.accountId,threadId:t.threadId,sessionKey:t.sessionKey}}function Fa(){if(D.fallbackChannel)return _e(D.fallbackChannel)}async function qp(){let t=await fetch(Op,{headers:{accept:"application/json"},signal:AbortSignal.timeout(Lp)});if(!t.ok)throw new Error(`npm registry returned HTTP ${t.status}`);let e=await t.json(),n=Ua(e)&&typeof e.version=="string"?ht(e.version):void 0;return n?{version:n}:void 0}async function Up(t,e){let n=await Dp(t,e,{timeout:12e4,maxBuffer:1048576});return{stdout:n.stdout?.toString()??"",stderr:n.stderr?.toString()??""}}var rr=class{constructor(e){this.options=e;this.statePath=$p(e.stateDir,Np),this.notifier=e.notifier??new Dt,this.fetchLatestRelease=e.fetchLatestRelease??qp,this.runCommand=e.runCommand??Up,this.now=e.now??Date.now}options;statePath;notifier;fetchLatestRelease;runCommand;now;checkInFlight;maybeCheckForUpdate(e={}){this.checkInFlight||(this.checkInFlight=this.checkForUpdate(e).catch(n=>{`${Oi(n)}`}).finally(()=>{this.checkInFlight=void 0}))}async waitForIdle(){await this.checkInFlight}async installConfirmed(e,n){let r=ht(e);if(!r||!Wi(r))return"Could not determine which stable OCA version to update to.";await this.runCommand("openclaw",["plugins","update",`${Ni}@${r}`]);let o=this.readState();this.writeState({...o,updateInstalledVersion:r});let i=Ba(n?.route??Fa());if(i)try{return await this.sendRestartPrompt(i,r),`OCA update command completed for ${r}. Restart confirmation was sent.`}catch(s){`${r}${Oi(s)}`}return[`OCA update command completed for ${r}.`,"Restart the Gateway explicitly to load it: openclaw gateway restart"].join(`
58
58
  `)}async restartConfirmed(e){let n=ht(e);return await this.runCommand("openclaw",["gateway","restart"]),n?`Gateway restart requested for OCA ${n}.`:"Gateway restart requested."}dismiss(e){return this.postpone(e,"Dismissed")}remindLater(e){return this.postpone(e,"Will remind later about")}postpone(e,n){let r=ht(e),o=this.readState();return this.writeState({...o,...r?{dismissedVersion:r,lastDismissedAt:new Date(this.now()).toISOString()}:{}}),r?`${n} OCA ${r} update reminder.`:`${n} OCA update reminder.`}async checkForUpdate(e){let n=this.readState(),r=n.lastCheckedAt?Date.parse(n.lastCheckedAt):Number.NaN;if(Number.isFinite(r)&&this.now()-r<qa){await this.promptFromState(n,e);return}let o=new Date(this.now()).toISOString(),i={...n,lastCheckedAt:o};delete i.lastError,this.writeState(i);try{let s=await this.fetchLatestRelease(),a=ht(s?.version),d={...this.readState(),latestVersion:a};delete d.lastError,this.writeState(d),await this.promptFromState(d,e)}catch(s){throw this.writeState({...this.readState(),lastError:Oi(s)}),s}}async promptFromState(e,n){let r=ht(e.latestVersion);if(!Bp(r,this.options.currentVersion)||!this.shouldPromptForVersion(e,r))return;let o=Ba(n.route??Fa());o&&(await this.sendUpdatePrompt(o,r),this.writeState({...this.readState(),latestVersion:r,promptedVersion:r,lastPromptedAt:new Date(this.now()).toISOString()}))}async sendUpdatePrompt(e,n){await this.notifier.send(e,[`OCA update available: ${this.options.currentVersion} -> ${n}.`,"",`Update now will run: openclaw plugins update ${Ni}@${n}`,"If the update succeeds, OCA will ask separately before restarting the Gateway."].join(`
59
59
  `),[[this.options.actionButtonFactory(Bt,"plugin-update-install","Update now",{pluginUpdateVersion:n,route:{provider:e.channel,accountId:e.accountId,target:e.target,threadId:e.threadId,sessionKey:e.sessionKey}}),this.options.actionButtonFactory(Bt,"plugin-update-remind-later","Remind later",{pluginUpdateVersion:n}),this.options.actionButtonFactory(Bt,"plugin-update-dismiss","Dismiss",{pluginUpdateVersion:n})]])}shouldPromptForVersion(e,n){let r=e.promptedVersion===n?e.lastPromptedAt:void 0,o=e.dismissedVersion===n?e.lastDismissedAt:void 0,i=[r,o].map(s=>s?Date.parse(s):Number.NaN).filter(s=>Number.isFinite(s));return i.length===0?!0:this.now()-Math.max(...i)>=Wp}async sendRestartPrompt(e,n){await this.notifier.send(e,[`OCA ${n} update command completed.`,"","Restart the Gateway now to load the updated plugin?","This will run: openclaw gateway restart"].join(`
60
60
  `),[[this.options.actionButtonFactory(Bt,"plugin-update-restart","Restart Gateway",{pluginUpdateVersion:n}),this.options.actionButtonFactory(Bt,"plugin-update-remind-later","Remind later",{pluginUpdateVersion:n}),this.options.actionButtonFactory(Bt,"plugin-update-dismiss","Dismiss",{pluginUpdateVersion:n})]]),this.writeState({...this.readState(),restartPromptedVersion:n})}readState(){try{return Fp(JSON.parse(Tp(this.statePath,"utf-8")))}catch{return{}}}writeState(e){xp(_p(this.statePath),{recursive:!0});let n=`${this.statePath}.tmp`;Mp(n,JSON.stringify(e,null,2),"utf-8"),Cp(n,this.statePath)}};se();V();function jp(t){return t.length>80?`${t.slice(0,80)}...`:t}function Gp(t){return t.worktreePath?!t.originalWorkdir||t.originalWorkdir===t.worktreePath?`${t.worktreePath} (worktree)`:`${t.worktreePath} (worktree of ${t.originalWorkdir})`:t.workdir}function Hp(t){let e=["Session launched successfully.",` Name: ${t.sessionName}`,` ID: ${t.sessionId}`,` Harness: ${t.harness}`,` Permission mode: ${t.permissionMode}`,` Plan approval: ${t.planApproval}`,` Worktree strategy: ${t.worktreeStrategy??"off"}`,...t.repoIntegrationPolicy?[` Repo policy: ${t.repoIntegrationPolicy}${t.repoProvider?` (${t.repoProvider})`:""}`]:[],` Resolved workdir: ${Gp(t)}`,` Model: ${t.model??"default"}`,` Prompt: "${jp(t.prompt)}"`];if(t.reasoningEffort&&e.push(` Reasoning effort: ${t.reasoningEffort}`),t.fastMode&&e.push(" Fast mode: enabled"),t.resumeSessionId){let n=t.resumeSessionName?`${t.resumeSessionName} [${t.resumeSessionId}]`:t.resumeSessionId;e.push(` Resume: ${n}${t.forkSession?" (forked)":""}`),!t.forkSession&&t.resumeSessionName&&t.sessionName!==t.resumeSessionName&&e.push(` Follow-up label: ${t.sessionName}`)}else t.forceNewSession&&e.push(" Force new session: true");return t.clearedPersistedCodexResume&&e.push(" Thread state: historical Codex state cleared; starting a fresh thread."),e.push(" Mode: multi-turn (use agent_respond to send follow-up messages)"),e.push("","Use agent_sessions to check status, agent_output to see output."),e.join(`
@@ -2,7 +2,7 @@
2
2
  "id": "openclaw-code-agent",
3
3
  "name": "OpenClaw Code Agent",
4
4
  "description": "Multi-session coding-agent orchestration from OpenClaw chat",
5
- "version": "4.7.2",
5
+ "version": "4.7.3",
6
6
  "contracts": {
7
7
  "tools": [
8
8
  "agent_launch",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-code-agent",
3
- "version": "4.7.2",
3
+ "version": "4.7.3",
4
4
  "type": "module",
5
5
  "packageManager": "pnpm@10.30.0",
6
6
  "main": "dist/index.js",
@@ -36,8 +36,8 @@
36
36
  "minHostVersion": ">=2026.7.1"
37
37
  },
38
38
  "compat": {
39
- "pluginApi": ">=2026.4.21",
40
- "minGatewayVersion": "2026.4.21"
39
+ "pluginApi": ">=2026.7.1",
40
+ "minGatewayVersion": "2026.7.1"
41
41
  },
42
42
  "build": {
43
43
  "openclawVersion": "2026.7.1",
@@ -95,7 +95,7 @@
95
95
  },
96
96
  "description": "An OpenClaw plugin that orchestrates coding agent sessions as managed background processes. Launch, monitor, and control coding agents (Claude Code, Codex, experimental OpenCode, and more) directly from your AI gateway.",
97
97
  "peerDependencies": {
98
- "openclaw": ">=2026.4.21"
98
+ "openclaw": ">=2026.7.1"
99
99
  },
100
100
  "overrides": {
101
101
  "basic-ftp": "5.3.1",