with one click
diagnose-integration
// Diagnose SwiftASB integration failures across Codex CLI discovery, app-server startup, initialization, threads, turns, approvals, MCP status, diagnostics, history paging, and live-test isolation.
// Diagnose SwiftASB integration failures across Codex CLI discovery, app-server startup, initialization, threads, turns, approvals, MCP status, diagnostics, history paging, and live-test isolation.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | diagnose-integration |
| description | Diagnose SwiftASB integration failures across Codex CLI discovery, app-server startup, initialization, threads, turns, approvals, MCP status and resources, worktree grouping, selected Git status, project identity, thread source, filesystem/config/extension/workspace reads, feature policy, feature-operation events, diagnostics, history paging, and live-test isolation. |
| license | Apache-2.0 |
| compatibility | Designed for Codex and compatible Agent Skills clients working with SwiftASB v1.3.1 or newer, Swift 6, SwiftPM, SwiftUI, AppKit, CLI tools, package libraries, and local Codex app-server integrations. |
| metadata | {"owner":"gaelic-ghost","repo":"socket","package":"SwiftASB","category":"swiftasb-diagnostics"} |
| allowed-tools | Read Bash(rg:*) Bash(git:*) Bash(swift:*) Bash(xcodebuild:*) |
Find the concrete failure point in a SwiftASB integration and explain it in terms the app maintainer can act on.
The job is not just to say that "Codex failed." A useful diagnosis identifies which boundary failed: package dependency wiring, Codex CLI discovery, app-server process startup, initialization, app-wide library refresh, worktree grouping/filtering, selected Git status, project identity or thread-source mapping, thread creation, stored-thread archive state, turn lifecycle, interactive request routing, filesystem/config/extension/MCP-resource/workspace reads, feature policy, feature-operation events, model capability reads, MCP status, hook diagnostics, diagnostic stream handling, local history reads, or live-test isolation.
CodexAppServerError, app-server transport failures, protocol failures, same-thread turn rejection, missing Codex CLI, MCP status or resource issues, approval or elicitation problems, filesystem/config/extension/workspace read failures, selected Git status failures, feature-category disabled errors, feature-operation event confusion, project identity or thread-source mismatches, config warnings, deprecation notices, remote-control status changes, or history paging failures.Verify current SwiftASB docs and public API before naming exact symbols:
README.mdSources/SwiftASB/SwiftASB.docc/GettingStartedWithSwiftASB.mdSources/SwiftASB/SwiftASB.docc/HandlingTurnProgressAndApprovals.mdSources/SwiftASB/SwiftASB.docc/ReadingDiagnosticsAndHistory.mdSources/SwiftASB/SwiftASB.docc/AppWideCapabilities.mdSources/SwiftASB/SwiftASB.docc/ThreadHistoryAndObservables.mdSources/SwiftASB/SwiftASB.docc/CodexFS.mdSources/SwiftASB/SwiftASB.docc/CodexConfig.mdSources/SwiftASB/SwiftASB.docc/CodexExtensions.mdSources/SwiftASB/SwiftASB.docc/CodexWorkspace.mdSources/SwiftASB/SwiftASB.docc/FeaturePermissionPolicy.mdSources/SwiftASB/SwiftASB.docc/ThreadManagement.mdSources/SwiftASB/Public/CodexAppServer+Library.swiftSources/SwiftASB/Public/CodexAppServer+LoadedThreads.swiftSources/SwiftASB/Public/CodexAppServer+CodexExtensions.swiftSources/SwiftASB/Public/CodexAppServer+MCP.swiftSources/SwiftASB/Public/CodexFS.swiftSources/SwiftASB/Public/CodexConfig.swiftSources/SwiftASB/Public/CodexWorkspace.swiftSources/SwiftASB/Public/CodexAppServer+Bootstrap.swiftSources/SwiftASB/Public/CodexAppServer.swiftSources/SwiftASB/Public/CodexDiagnostics.swiftSources/SwiftASB/Public/CodexErrors.swiftThe current Codex app-server API includes lifecycle operations such as thread/start, thread/resume, thread/fork, thread/archive, thread/unarchive, turn/start, turn/steer, turn/interrupt, filesystem reads and watches, config reads, extension inventory, MCP resource reads, command/exec, model/list, modelProvider/capabilities/read, mcpServerStatus/list, and hooks/list, plus notifications for thread status, command output, MCP startup status, config warnings, deprecation notices, remote-control status, hook activity, filesystem watch activity, and skills/plugin state. Use the official Codex app-server docs when the diagnosis depends on upstream app-server behavior rather than SwiftASB's public wrapper.
Check that the package dependency is real and remote-fetchable:
.package(url: "https://github.com/gaelic-ghost/SwiftASB", from: "1.3.1")
Then check the target that talks to Codex depends on:
.product(name: "SwiftASB", package: "SwiftASB")
Do not commit machine-local package paths such as /Users/..., ~/..., or ../SwiftASB into public projects.
SwiftASB expects a local Codex CLI runtime. A diagnosis should tell the maintainer which executable was attempted and whether SwiftASB reported it as supported.
For SwiftASB v1.3.1, treat Codex CLI 0.130.x as the current reviewed schema family unless the SwiftASB README or release notes have moved that support window.
For normal clients, CodexAppServer.start(_:) returns StartupSession.cliExecutableDiagnostics after launching, validating the selected Codex CLI against the reviewed support window, and initializing. Use CodexAppServer.cliExecutableDiagnostics() after lower-level start() when a UI, CLI, or test intentionally needs to show executable facts before deciding whether to initialize.
If the app requires a fixed binary, inspect whether it passes CodexAppServer.Configuration.codexExecutableURL.
The expected order for most clients is:
CodexAppServerstart(_:) with client metadataStartupSession.cliExecutableDiagnostics when the UI needs selected-CLI factsWhen diagnosing SwiftASB v1.3.1 or newer, first check whether the thrown error is CodexAppServerStartupError. codexCLINotFound points at executable discovery, incompatibleCodexCLI and unknownCodexCLIVersion point at reviewed-support-window validation, launchFailed points at process startup, and initializeFailed points at protocol initialization or malformed client metadata.
Use the lower-level sequence only when the app intentionally owns custom diagnostics or compatibility decisions:
CodexAppServerstart()cliExecutableDiagnostics()initialize(_:) once with client metadataIf lower-level initialization fails, separate process startup from protocol initialization. Startup failures are usually executable, environment, sandbox, or process problems. Initialization failures are usually protocol, compatibility, or malformed client metadata problems.
Use CodexAppServer for app-wide stored-thread operations and thread creation. Use CodexThread for conversation-scoped actions.
Check whether the app is:
CodexThreadUse CodexAppServer.makeLibrary(configuration:) when a UI or package needs stored-thread lists before choosing a thread.
If a library surface does not update, check whether the app is:
Library.GroupedBy.cwd matches exact app-server cwd metadataselectedGitStatus to exist when gitObservability is disabled, no thread is selected, or the selected worktree has no usable cwdrefreshAppSnapshots() has loaded model, MCP, and hook dataCodexWorkspace.ProjectInfoCodexAppServer.ThreadSourceselectedThreadID as stored Codex metadata instead of library-local UI selection statelatestGitStatusErrorDescription or treating selected Git status refresh as direct app-process filesystem access instead of sandboxed app-server command/execUse app-server-owned fact surfaces when a sandboxed app, helper, or package should not inspect machine state directly:
CodexAppServer.fs for metadata, directory entries, file bytes, watches, and bounded fuzzy file discoveryCodexFS.FileDiscoveryQD when file-picker or search intent should be repeatable stateCodexFS.FileDiscoveryHit.matchKind, matchedFileNameRanges, matchedRelativePathRanges, and rankingReasons when fuzzy search UI ranking or highlighting looks wrongCodexAppServer.config for effective config and requirements readsCodexAppServer.extensions for apps, skills, plugins, and collaboration modesCodexAppServer.extensions.upgradeMarketplace(_:) for upgrading an already-configured plugin marketplace when extensionMaintenance is enabledCodexAppServer.readMcpResource(_:) for app-wide or thread-scoped MCP resource contentsSwiftASBFeaturePolicy for feature-category defaults and host app authorityCodexAppServer.featureOperationEvents() for human-readable SwiftASB-owned mutation recordsCodexWorkspace values on requests and thread sessions for active permission profile, cwd, worktree snapshots, project identity, Git repository facts, selected Git status snapshots, and filesystem/network permissionsIf one of these surfaces fails, check whether the app passed the right current directory, expected direct disk semantics from an app-server read, asked for unpromoted mutation behavior, disabled the relevant feature category, or hid app-server permission/profile facts behind a local fallback.
SwiftASB feature policy is separate from Codex approval requests. It decides whether SwiftASB-owned convenience features such as Git observability or extension maintenance are eligible to run; it does not answer a turn's approval prompt.
If a feature operation fails, check:
CodexAppServer.Configuration.featurePolicy or CodexAppServer.Library.Configuration.featurePolicy disables the categoryfeatureOperationEvents() emitted a started, succeeded, failed, cancelled, or skipped eventRoutine read-only refreshes should usually be quiet. Missing feature-operation events for Git status reads or extension inventory is expected unless a mutation or maintenance action ran.
Use CodexThread.startTextTurn(...) to create a CodexTurnHandle. Use that handle for active-turn events, steering, interruption, interactive responses, and completion handoff.
If a turn does not behave as expected, check:
turn.eventscomplete() is called only after terminal state when a sealed local snapshot is neededinterrupt() rather than dropping the handle silentlySwiftASB rejects overlapping turns on the same thread with CodexAppServerError.invalidState because the live app-server does not expose a reliable independent lifecycle for same-thread overlap.
Approval and elicitation requests are not diagnostics. They are server-originated requests that need typed responses.
Use the same owner that received the request:
CodexTurnHandle.respond(to:with:) for active-turn requestsCodexThread.respond(to:with:) for thread-scoped requestsIf a request response fails, check that the response is sent through the matching thread or turn owner and that the app is not trying to answer a passive diagnostic event.
CodexAppServer.diagnosticEvents() reports passive runtime diagnostics such as:
warningguardianWarningmodelReroutedmodelVerificationconfigWarningdeprecationNoticemcpServerStatusChangedremoteControlStatusChangedDiagnostics explain what the runtime is warning about. They are not approval prompts and do not need responses.
Use app-wide snapshots for settings, inspectors, and runtime health:
CodexAppServer.listModels(...)CodexAppServer.readModelCapabilities()CodexAppServer.listMcpServerStatuses(...)CodexAppServer.listHooks(...)CodexAppServer.Library.refreshAppSnapshots()If a model, MCP, or hook issue appears in the UI, inspect whether the app is showing model feature gates, configured server status, auth state, tools/resources metadata, hook diagnostics, or startup notifications. Do not infer runtime health only from a failed turn unless the app-wide status surface has also been checked.
Distinguish local history helpers from direct app-server paging.
Use recent companions and local history helpers for UI history:
CodexThread.makeRecentTurns(...)CodexThread.makeRecentFiles(...)CodexThread.makeRecentCommands(...)CodexThread.HistoryWindowQDCodexThread.RecentFilesQDCodexThread.RecentCommandsQDCodexThread.readRecentTurnHistoryWindow(limit:)CodexThread.windowAroundTurn(...)CodexThread.windowAroundItem(...)Use CodexAppServer.listThreadTurns(...) when the app specifically needs direct app-server paging and is prepared to surface app-server failures.
Recent companions may start from an empty local view for ephemeral or not-yet-materialized history while still listening to live events. That is different from a lower-level remote paging failure.
Keep normal package tests deterministic. Use live Codex probes only when the purpose is runtime compatibility or real app-server behavior.
Live probes should be:
Return:
Most likely boundary: the narrow failure boundary.Evidence: the log, code path, command, or API behavior that supports it.What it means: plain-language impact for the app or package.Fix: one narrow repair path.Validation: exact command or manual check.Escalate to SwiftASB?: yes/no, with the reason.