Skip to documentation
KonclaveDocumentationSource snapshot · Apache 2.0
Browse documentation

Run the local two-session demo

Run Konclave's local Copilot demo on Windows, prepare a real relay and user-scoped extension, and connect two sessions with checked prerequisites and cleanup.

GuideSource revision 8d0d3676e9fcView authoritative source

Repository-relative paths and “this checkout” refer to the Konclave source repository, not this website. The source link above identifies the exact revision used here.

On this page

The Windows demo script prepares a real local relay and user-scoped Copilot extension without Docker, a local Rust toolchain, or manual credential handling.

Prerequisites

  • PowerShell 7.4 or later;
  • authenticated gh access to this public repository;
  • an installed and authenticated Copilot CLI; and
  • a local checkout on a named same-repository branch containing the script.

Validate prerequisites and the local safety checks without changing demo state:

Code example
pwsh -NoProfile -File .\scripts\demo\Start-KonclaveLocalDemo.ps1 -Validate

Start

From the repository root:

Code example
pwsh -NoProfile -File .\scripts\demo\Start-KonclaveLocalDemo.ps1

The first run:

  1. dispatches an independently correlated, Windows-only package workflow on the current named branch;
  2. waits only for the Windows candidate;
  3. requires the workflow source revision to equal the local checkout, downloads roughly 31 MB, and checks each archive hash against its co-produced unsigned provenance before cancelling the remaining demo dispatch;
  4. deletes every artifact belonging to that exact workflow run and confirms zero remain;
  5. rejects unsafe or oversized ZIP entries, then extracts the CLI, shared service, relay, and built extension payload beneath the current user’s local application-data directories;
  6. generates enrollment authority directly into Windows native credential custody;
  7. starts the loopback relay as a hidden process;
  8. runs init --authorization-policy account-trusted and doctor;
  9. creates owner-protected service/issuer state, installs the thin extension and sidecar-adjacent Generic client, removes any unchanged Generic skill owned by an earlier demo from Copilot’s paved harness, and starts exactly one hidden shared-service process;
  10. runs doctor through the live owner-authenticated named pipe; and
  11. records the exact relay and service process identities for safe shutdown.

When upgrading from the per-session daemon build, setup replaces the extension entry point in place so fresh sessions use the thin client. If an existing session still holds the old executable open, setup defers deletion of only that legacy bin directory and retries exact removal on later runs after the session exits.

The unsigned provenance provides digest consistency and binds the package to the checked-out source revision. It does not establish publisher authenticity or replace the future signing and attestation work.

AccountTrusted deliberately trusts every process under the current Windows account; the demo does not claim isolation between hostile same-user sessions. Each extension still uses a memory-only session key and a finite exact-profile grant, while the installed account key remains issuance-only.

Later runs reuse the installed candidate. Use -Refresh to rebuild and replace it:

Code example
pwsh -NoProfile -File .\scripts\demo\Start-KonclaveLocalDemo.ps1 -Refresh

Close existing Copilot sessions after setup so fresh sessions discover the extension. The extension reads the endpoint, issuer registration, explicit policy, pinned service key, and issuer-key path from its bounded owner-protected sidecar. It never receives a daemon path or profile root. During this pre-release schema-v2 cut, -Refresh removes only schema-v1 authorization configuration after stopping the exact recorded service; profile and conversation state remain.

Slash-command output defaults to concise normal summaries. Run /konclave output verbose in one session when diagnosing identifiers, grant capacity, delivery state, or pairing phases; /konclave output normal restores the default. This presentation setting lasts only for the current extension process.

Pair two sessions

Open fresh Copilot CLI sessions in two repositories.

In the first session:

Code example
/konclave connect

Keep that command running and copy its single 26-character ephemeral token to the other session:

Code example
/konclave connect <token>

Use /konclave connect --copy to place only the compact token on the native clipboard, or /konclave connect --qr to render a terminal QR code containing a konclave://pair/<token> URI. The receiving command accepts either the URI or raw token through the same parser. Clipboard and QR failures degrade to the raw token; /konclave clipboard clear clears a token copied by the current extension session.

Both sessions display the current durable phase, the action expected from the other device, and the remaining pairing time. If a Copilot process is interrupted before completion, restart it and continue the durable pairing with:

Code example
/konclave connect resume <pairing-id>

An expired command requests cancellation before returning. Neither side reports connected until its completed conversation is durable in the local profile.

If compact rendezvous is unavailable, /konclave pair member and /konclave join <capability> retain the full-capability recovery flow.

Both commands complete with the same conversation identifier. Send from either side with:

Code example
/konclave send -- <message text>

To request one automatic terminal response in a two-member conversation, use:

Code example
/konclave use <conversation-id>
/konclave request -- <request text>

For a group conversation, obtain the intended peer’s full identifier with /konclave identity in that session and name it explicitly:

Code example
/konclave request --to <target-device-id> -- <request text>

This uses the selected conversation. An explicit conversation before the options overrides it. The existing positional group-target form remains supported. Only newly established membership whose root-signed credential advertises directed requests is eligible. An older conversation remains usable for ordinary messages but must be paired again before it can carry this request kind.

That selection is stored in the session’s durable profile, so send, request, reply, messages, diagnose, mute, unmute, and inviter-side approve continue to use it after the Copilot session is restarted or resumed. Each accepts an explicit conversation identifier to override the selection for that operation. Successful explicit sends, replies, and requests also select their conversation; inspection and muting do not. Implicit commands read the current durable selection each time. A selection changed by an agent tool is therefore immediately visible to slash commands in the same session; restarting the session or listing conversations is not required. Profiles upgraded from an earlier candidate deliberately do not guess among existing conversations. If /konclave conversations shows no active selection, choose the intended identifier once with /konclave use <conversation-id>. Selection does not change that conversation’s automatic-delivery mute state.

For example, after use, run messages [after-cursor], reply <reply-to-message-id> [message-id] -- <text>, diagnose <message-id>, mute, or unmute without repeating the conversation. A 32-hex message identifier before -- retries an implicit send or request. A leading 64-hex identifier always means an explicit conversation, not a target device. Use request [message-id] --to <target-device-id> -- <text> to target a group member without repeating the selected conversation. The legacy explicit form remains request <conversation-id> <target-device-id> [message-id] -- <text>. Do not combine --to with a positional target. All options precede --; text after that delimiter is message content, not command options.

The two-command flow is an explicit AccountTrusted convenience policy. Capability creation and redemption are treated as the two same-account approval actions; status states that no independent identity verification occurred, and only the member role is granted. Stronger authorization policies and administrator grants use the manual pair, join, new, approve, and sync commands.

On the inviter side, verify the displayed joiner device, select an existing conversation with /konclave use <conversation-id> or create a selected one with /konclave new, then run /konclave approve <pairing-id>. The grant defaults to member. Use /konclave approve <pairing-id> administrator only when the peer requested that role and the native authorization checks allow it. The explicit override remains /konclave approve <pairing-id> <conversation-id> [role]; approval does not change the selected conversation.

On the joiner side, approval still requires every displayed authenticated value: /konclave approve <pairing-id> <inviter-device-id> <conversation-id> <role>. The incoming conversation may not exist locally yet. Selection never replaces this explicit identity, conversation, and role confirmation.

The capability remains terminal-visible and may appear in local CLI input history. It is protected by short expiry, one-time consumption, and daemon-side zeroization, not by the ephemeral display flag. Do not paste it into logs or public artifacts.

The idle peer receives messages automatically. On resume, the extension waits through a five-second startup grace before treating a session with no observed user, assistant, or tool activity as idle; observed activity cancels that inference, and the next explicit idle event remains authoritative. /konclave messages <conversation-id> performs an explicit bounded sync/read when diagnosing delivery, and /konclave reply <conversation-id> <reply-to-message-id> [message-id] -- <message text> records a reply relationship when desired. Reply prints the generated message identifier before sending; reuse it in the optional position after a transport failure to reconcile the same operation instead of creating a duplicate.

The accepting connect command creates a durable conversation before the remote command completes. If the pairing is abandoned or times out, that empty conversation remains visible in /konclave conversations; the command does not hide this non-atomic boundary.

Admission-limited requests

The send_directed_request tool accepts optional structured delivery fields. Set delivery_receipts: true to request encrypted delivery observations without a cutoff, or supply expires_at_unix_milliseconds as a positive, safe-integer absolute Unix millisecond cutoff. A cutoff implicitly requests receipts; combining it with delivery_receipts: false is rejected. Omitting both fields preserves plain requests. These are tool arguments, not slash-command flags or instructions in the body.

The target must advertise the new root-signed capability. Existing credential bindings are not rewritten by an executable upgrade; an unsupported conversation fails visibly instead of silently ignoring the cutoff.

Inspect read_messages or /konclave messages for admitted, expired_before_admission, and ended_without_response delivery metadata. An actual correlated answer establishes a response. Receipts never wake either model or ask for an acknowledgement; they do not prove task success or external execution. Callers own any retry and execution budget. See the delivery contract for clock, compatibility and recovery limits.

Browse message history

History uses the conversation selected with /konclave use, unless an explicit conversation overrides it. The slash command defaults to newest-first durable cursor order; --order asc restores oldest-first browsing:

Code example
/konclave messages
/konclave messages --order asc
/konclave messages <conversation-id> --order desc
/konclave messages --since 2026-10-01T00:00:00Z --until 2026-11-01T00:00:00Z
/konclave messages --since 2026-10-01T09:00:00+02:00
/konclave messages <conversation-id> --before-cursor <cursor>

Each message displays its sender timestamp as UTC ISO 8601 ending in Z, in normal and verbose output. A sender value outside the supported date range produces an explicit timestamp diagnostic without hiding the message. Sender clocks can differ or move backward: timestamps are display/filter metadata, not trusted ordering, replay, or authorization authority.

--since is inclusive and --until exclusive: [since, until). Either bound can be used alone. Values must be valid RFC 3339 instants with an explicit timezone; offsets normalize to UTC. Invalid calendar dates, leap seconds, repeated options, and reversed ranges are rejected. Filters compare the existing integer-millisecond sender timestamps; fractional-millisecond bounds are rounded upward consistently with the half-open interval.

Every command performs one bounded sync and one bounded history read. Timestamps remain sealed, so a sparse date range can require multiple authenticated scans, including pages with no matches. When more candidates remain, copy the printed continuation command: it preserves the conversation, order, dates, and cursor bounds, and advances past the last scanned record rather than the last match. An empty bounded scan does not mean the entire history has no matches.

The legacy positional [after-cursor] remains an exclusive lower cursor bound, including when browsing newest-first. --before-cursor is an exclusive upper bound and enables backward continuation. Neither bound is an offset. Native read_messages callers retain their existing ascending default; the slash command requests descending order explicitly.

Automated two-session smoke

The complete local agent scenario creates two empty-mode Copilot SDK sessions, pairs their packaged Konclave clients, activates one exact structured policy, sends one send_directed_request, and permits the targeted session to make one correlated send_message call. The response is delivered as terminal ordinary text, is rejected as another autonomous turn, and is followed by bounded empty delivery watches on both sessions.

The runner keeps capabilities, policy annotations, prompts, model responses, tool arguments, credentials, and user-provided content out of its report. It uses a dedicated smoke state root and loopback port under the demo directory, so historical manual-demo profiles cannot exhaust its bounded preflight diagnostics and existing package installation, relay access, service identity, Copilot extension sidecar, and profile state are neither overwritten nor deleted. When the entry point performs setup, it stops only that isolated relay and shared service after the smoke while preserving their state. -SkipSetup leaves the caller-managed processes running.

This is deliberately a local development smoke. Both the PowerShell entry point and the TypeScript runner refuse recognized CI environments. No repository workflow invokes it, and its live result must never be uploaded as an Actions artifact. CI only compiles, lints, and unit-tests the deterministic runner with no Copilot inference.

Use -SkipSetup to reuse an already-running relay or -Refresh to rebuild the packaged Windows candidate before the smoke.

Stop

Code example
pwsh -NoProfile -File .\scripts\demo\Start-KonclaveLocalDemo.ps1 -Stop

Stop mode terminates the recorded shared service and relay only after verifying each executable and start time. Profile, relay state, installed files, and the user-scoped extension remain for the next demo run.

To remove the user-scoped extension explicitly:

Code example
pwsh -NoProfile -File .\scripts\demo\Start-KonclaveLocalDemo.ps1 -Stop -UninstallExtension

If setup enabled Copilot’s experimental setting, explicit extension removal restores the prior setting. The script also removes the obsolete direct-plugin registration created by earlier demo versions. Setup and uninstall remove a Generic skill installed by an earlier demo only when its ownership record and exact installed hash still match. A pre-existing or modified user skill is never overwritten or recursively removed.

The demo uses an HTTP loopback relay. Packaged acceptance separately proves the same flows through trusted TLS and the Docker-loaded relay candidate.

Content: Konclave,Apache-2.0. Revision: 8d0d3676e9fc746749a4fc04ddeb4499023c4104.