Lossless Codex Orchestrator
Use this skill when an OpenClaw agent needs to understand or safely manage local
Codex sessions through the installed lco_* tools.
Safety Boundary
- Prefer local
lco_*tools through the OpenClaw gateway. - Treat the compact public facade as the normal path; do not rank every declared tool as an equal first step.
- Start with public-safe summaries, metadata, refs, and bounded expansion.
- Do not read raw transcripts when a
lco_*describe, expand, final, plan, or touched-file tool can answer the question. - Keep LCO local-only unless the user explicitly exports a public-safe report.
- Preserve Codex approval and sandbox gates. OpenClaw approval authorizes the requested LCO action only.
- Live resume, send, steer, or interrupt actions require a matching dry-run and
approval_audit_id. - Claude Code is adapter-stub only in this beta; use Codex-first claims.
- Desktop fallback proof is action-bound; do not claim generic GUI mutation.
cli_visibleor app-server-visible is not the same as Codex Desktop-visible collaboration. Uselco_codex_desktop_coherencebefore making any Desktop visibility claim.- When Desktop visibility is not proven, use
lco_codex_desktop_fallback_statusto inspect CUA-first and Peekaboo-secondary readiness before suggesting any visible fallback path. - Use
lco_codex_collaboration_cockpitwhen the user wants one read-only active-lane summary across recent cards, inbox urgency, watcher requests, and supplied Desktop coherence/fallback evidence. - Use
lco_codex_collaboration_next_stepsafter the cockpit when you need the exact next bounded tool call. Its packets are read-only suggestions withexecute=false; do not treat them as approval to run live control or GUI actions. - Use
lco_codex_runtime_desktop_visibility_statuswhen you need one compact lane-level answer about which Codex Desktop collaboration lanes are covered, partial, or blocked. Treat any returned next tool call as a read-onlyexecute=falserecommendation, not as approval to mutate the Desktop. - Use
lco_codex_active_thread_statewhen you need one compact read-only answer about which active threads are running, blocked, stale, or need a nudge. UsenextControlDryRunonly as a non-executed dry-run handoff; treat low-confidence or conflicting states as inspect-first, never as approval to send or steer. LCOis the public product abbreviation. New user-facing examples uselco_*; the historicalloo_*names remain maintained compatibility aliases for at least two minor releases and invoke the same targets. Concrete maintained aliases includeloo_search_sessions,loo_expand_query, andloo_codex_control_dry_run; prefer the matchinglco_*names in new output.LCO_TOOL_PROFILE=facade|standard|allfilters MCP/OpenClaw tool listing.facadelists the compact public path and itslco_*aliases,standardadds workflow-detail tools such aslco_doctor, andallremains the default full catalog.LCO_TELEMETRY=1enables opt-in retrieval telemetry only for local search-to-describe/expand correlation. It writes LCO-owned derived cache, requires a telemetry session id for correlation, and does not store raw query text.
Compact Public Facade
Normal agents should start here:
lco_index_sessionswith bounded roots or limits for first-run or stale-index refresh, thenlco_findfor public-safe matches from one query.lco_prepared_inboxfor the prepared-state operating picture.lco_describe_reffor the specific source ref or Codex thread.lco_expand_queryfor one bounded evidence brief when the ref is not known.lco_recent_sessionsto refresh recent or active cards after a read or approved action.lco_attention_inboxfor the compact attention queue.lco_project_digestfor bounded provenance and handoff.lco_codex_control_routefor one opaque, expiring Codex target or the explicit Desktop-observation route.lco_codex_deliverfirst withdry_run:true, then with the identical bindings,dry_run:false, and the matching approval id.
Use workflow_detail, proof_debug, and internal_low_level tools only when
the facade output or a proof/debug task gives you a specific reason. Expert
tools remain explicit so blockers, safety state, and proof boundaries can be
inspected instead of hidden behind a single magic command.
Find Active Codex Sessions
- Call
lco_doctorto confirm the local DB, Codex stores, and tool readiness. If itscodexJsonlDriftblock reports drift, recall may be incomplete for the flagged files: newer Codex event kinds are being observed that the parser does not extract yet. Treat that as a caveat on completeness claims, not an error. - If the index is stale, call
lco_index_sessionswith bounded roots or limits. - Call
lco_search_sessionswith a narrow query and a small limit. - Prefer returned thread ids, source refs, status, latest timestamp, and safe summary fields over raw event text.
Describe This Session
- Use
lco_describe_refwiththread_idfor a known Codex thread. - Use
lco_describe_refwithsource_reffor a source-prefixed ref such ascodex_thread:*. - Summarize status, project, likely objective, blockers, latest assistant closeout, and next safe action.
Expand 1k/4k
- Use
lco_expand_sessionwhen you already know thethread_id. - Use
lco_expand_querywhen you have a query and want the best matching ref. - Use
profile=briefortoken_budget=1000for a quick handoff. - Use
profile=evidenceortoken_budget=4000only when the agent needs a stronger evidence bundle. - Stop expanding once the next action is clear.
Find Plans, Finals, And Touched Files
Use the Codex detail tools instead of expanding entire sessions:
lco_codex_extractwithkind: "plans"for proposed-plan blocks and plan refs.lco_codex_extractwithkind: "final_messages"for latest final assistant messages.lco_codex_extractwithkind: "touched_files"for files likely touched by the session.lco_codex_extractwithkind: "tool_calls"when tool metadata matters, without reading full tool call payloads.lco_codex_session_management_mapwhen the agent needs the session-management view before recommending archive, fork, resume, or handoff.
Route, Dry-Run, And Deliver
- Call
lco_codex_control_routeto obtain one opaque, expiring target. - Call
lco_codex_deliverwithdry_run:true. - Inspect the target binding, action,
params_hash, and anymessage_hash. - Ask the user to approve that exact target and action.
- Repeat the identical
lco_codex_delivercall withdry_run:falseand the returnedapproval_audit_id. - If delivery reports a missing or mismatched audit id, stop and route again; do not repair or reuse the rejected approval.
- Immediately before a separately approved interrupt, route again and require a fresh active, turn-bound target. An idle delivery changes task state, so never reuse its pre-delivery target for interrupt.
Use workflow-detail tools such as lco_codex_control_dry_run,
lco_codex_resume_thread, lco_codex_send_message,
lco_codex_steer_thread, and lco_codex_interrupt_thread only when the facade
result explicitly routes to that lower-level fallback.
Check Desktop Coherence
- Use
lco_codex_app_server_statusandlco_codex_app_server_threadsfor read-only direct/app-server signals. - Use
lco_visible_codex_maponly with public-safe visible metadata; do not select, click, type, refresh, restart, or capture screenshots by default. - Call
lco_codex_desktop_coherencewith the targetthread_idorsource_refand the public-safe map evidence. - Treat
desktop_visibleas a proven visibility state only for the supplied evidence. Treatcli_visible,desktop_refresh_required,desktop_restart_required, andunknownas gap states. - If visibility is not proven, call
lco_codex_desktop_fallback_statusand route blockers to the desktop fallback lane rather than claiming same-session Desktop collaboration. If fallback status returnscoherence_input_missing, run the exactlco_codex_desktop_coherencenextToolCallbefore retrying fallback readiness. - Call
lco_codex_collaboration_cockpitwhen the next response should combine recent cards, inbox urgency, watcher requests, and supplied Desktop evidence into one public-safe attention summary. - Call
lco_codex_collaboration_next_stepswhen you need exact next tool packets for watcher resume requests, Desktop coherence, or fallback-status checks. Execute nothing from the planner unless a later tool has its own approval gate. - Call
lco_codex_runtime_desktop_visibility_statuswhen you need a compact covered/partial/blocked status for runtime Desktop visibility across active lanes. It reports source coverage and next read-only proof steps only. - Call
lco_codex_active_thread_statewhen you need active-thread state counts and reason codes before recommending attention order. If an item includesnextControlDryRun, show it as anexecute=falsedry-run recommendation, not as a live-control approval.
Recommended Agent Loop
- Start with
lco_findwhen the user gives a query and the index is current, or calllco_index_sessionsfirst when the database is new or stale. Start withlco_prepared_inboxwhen the user asks what needs attention. - Use
lco_describe_reffor the selected inbox/source ref. - When resuming a known Codex thread, use
lco_prepared_state_statuswiththread_id; treattargetCoverage.status=source_present_not_indexedoractive_session_pending_indexas a cache-refresh route, not as a missing thread or raw-transcript permission. - Use
lco_expand_querywith a 1k budget only when the compact card and describe output are not enough. - Use
lco_recent_sessions,lco_attention_inbox, orlco_project_digestto refresh the operating picture or handoff. - Use
lco_doctor,lco_search_sessions,lco_describe_ref,lco_expand_session, andlco_codex_extractonly as workflow-detail fallbacks when the facade cannot answer the task. - Optionally run
lco_codex_desktop_coherencewhen the user asks whether the same work is visible in Codex Desktop - If Desktop visibility is not proven, run
lco_codex_desktop_fallback_statusbefore recommending CUA/Peekaboo work; if it returnscoherence_input_missing, run the returned coherence call first - Run
lco_codex_collaboration_cockpitwhen the user wants one active-lane cockpit summary - Run
lco_codex_collaboration_next_stepswhen the next action needs an exact tool packet instead of prose - Run
lco_codex_runtime_desktop_visibility_statuswhen the user asks what is actually covered for Desktop-visible collaboration right now - Run
lco_codex_active_thread_statewhen the user asks which active Codex threads are running, blocked, stale, or need a nudge - Recommend a next action with source refs
- If action is requested, run
lco_codex_control_route, thenlco_codex_deliverwithdry_run:true - Wait for explicit approval, then repeat the identical delivery with
dry_run:falseand the matchingapproval_audit_id
Codex Desktop-First Daily Loop
Use this loop when the user wants the daily Codex operating picture, active Desktop collaboration state, or a safe next nudge recommendation.
- Start read-only with
lco_codex_app_server_status,lco_codex_app_server_threads, andlco_visible_codex_map. - Run
lco_codex_desktop_coherencebefore any Codex Desktop-visible claim. Treatcli_visible,desktop_refresh_required,desktop_restart_required, andunknownas proof gaps. - If coherence exists, use
lco_codex_desktop_fallback_statusfor fallback readiness. If it returnscoherence_input_missing, follow the returnednextToolCallfor coherence first. - Build the daily attention view with
lco_codex_collaboration_cockpit,lco_codex_runtime_desktop_visibility_status,lco_codex_active_thread_state, andlco_codex_autonomy_tick. - For
needs_nudgeorneeds_approval, shownextControlDryRunas anexecute=falsehandoff only. Do not run live control from this packet. Treat all autonomy tick steps as recommendations until the requesting user separately asks for and approves the exact action. - Live control requires the exact dry-run audit id, matching
approval_audit_id, and explicit requesting-user approval for the exact target and action. - After an approved live action, run post-action refresh before claiming success or updating the operating picture.
- If proof fails, create an issue-ready public-safe packet instead of pasting raw logs, raw transcripts, screenshots, or unredacted tool evidence.
Public-Safe Output Shape
When reporting to a user or another agent, include:
- thread id or source ref
- session title or safe summary
- status and latest timestamp
- proposed plan refs, final-message refs, touched files
- why the selected session matters
- next safe command or dry-run command
- explicit boundaries that remain unproven
Do not include raw prompt text, secrets, cookies, tokens, full transcripts, raw SQLite rows, screenshots, or unredacted tool payloads.