ox

command
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: MIT Imports: 122 Imported by: 0

Documentation

Overview

session_push_summary.go is the inline-summarization endpoint: it accepts a summary JSON produced by the calling agent (in response to the summary_prompt returned by `ox session stop`), validates and enriches it, then commits and pushes summary.json to the ledger.

Why two execution sites exist for summarization

Delegating summarization back to the calling agent is the right default *technically*: the agent already has the conversation in context (so input tokens are effectively free), no extra binary is required, and it works for every supported agent (Claude Code, Cursor, Aider, Codex CLI, …).

But it blocks the user at exactly the wrong moment. They have just signaled "I'm done" and want to close the agent or `/clear` and move on; an inline LLM call holds them in the foreground for 30–120s for a ~1–4KB JSON output. We should only force the inline path when the user has not specified (and ox cannot auto-detect) an LLM agent for daemon callouts.

The daemon-side equivalent lives in `internal/daemon/agentwork/session_finalize.go` and calls back into the shared `pushSummaryToLedger` flow below — so prompt construction and validation live in exactly one place. Today the dispatch is gated behind `SAGEOX_ASYNC_SESSION_UPLOAD=1` (see `cmd/ox/agent_session.go`); the plan is to lift that to a first-class `agent.summarizer` user-config key with `auto` as the default.

See ADR-016 (docs/adr/ADR-016-session-summarization-delegation.md) for the full rationale, behavior matrix, and tradeoffs.

session_repair_meta_summary.go is the ox-l4mj retro-cleanup tool.

Even after the producer-side fixes (ox-qqka, ox-wstd) ship, every existing ledger carries the leak forever unless retro-cleared. This command walks the ledger and fixes the on-disk truth: clears validator-error strings from meta.summary / meta.title, recovers a good title from summary.json when available, and stamps SummaryStatus so consumers don't have to keep sniffing for sentinel strings.

Idempotent and safe to run repeatedly. Designed to be invoked both from the CLI and (later) from the daemon's anti-entropy loop.

session_upload.go handles uploading session artifacts to the ledger.

AUTH MODEL: Upload uses Git PAT only (no OAuth required).

  • LFS upload: PAT via HTTP Basic auth (getLFSClient)
  • git push: PAT embedded in remote URL (RefreshRemoteCredentials)
  • checkUploadAccess: OAuth-based, fail-open, kept for viewer detection only

See docs/ai/specs/session-auth-model.md for the full auth model.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL