Skip to main content

pyagy

Antigravity CLI (agy 1.5.14) wire-compatible CLI harness built on top of pycodex and responses_server.

Quick Start

Start from config_examples/pyagy.config.toml and save it as ~/.codex/pyagy.config.toml (with GEMINI_API_KEY set in the environment or ~/.codex/.env):

model = "gemini-4-carbon-high"
model_provider = "gemini"
compat_api = "gemini"
harness = "pyagy"
model_reasoning_effort = "high"

[model_providers.gemini]
base_url = "https://api.example.invalid/v1beta"
env_key = "GEMINI_API_KEY"

Run from the CLI against any profile with compat_api = "gemini":

env -u VIRTUAL_ENV PYTHONPATH=.:packages/pyagy \
  uv run python -m pyagy --profile pyagy -p "Hello"

Compaction & Multi-Agent Messaging

  • Context Compaction & Tool Output Truncation (agy 1.5.14 wire parity):
    • Pre-invocation auto-compaction triggers when estimated context tokens reach the model's threshold (512000 for Gemini 4 Neon/Carbon/Argon, 256000 for Gemini 4 Hydrogen / 3.8 / 3.7 / 3.6 Flash / 3.1 Pro, or AGY_CLI_AUTO_COMPACT_OVERRIDE integer / 1..100%), with automatic overflow fallback on ContextLengthExceeded.
    • Sync and background run_command outputs (as well as other non-read_file plain-text tool outputs exceeding 10,240 UTF-8 bytes) apply exact middle truncation and persist full output under .system_generated/steps/<step_index>/output.txt.
    • Manual /compact and /compact <follow-up> emit the on-demand compaction prompt (maxOutputTokens 32768 / 16384), replace conversation history with <CONTEXT_SUMMARY>, and persist CHECKPOINT transcript steps across --continue / --conversation.
  • Subagent -> Root Messaging:
    • Subagents spawned via invoke_subagent receive the caller's conversation_id and can proactively send progress or questions back to root (or any live peer) via send_message(Recipient=<root_id>, Message=...), in addition to automatic idle reporting.

Web Workspace (pycodex-ws) Profile Integration

Add harness = "pyagy" (default is harness = "pycodex") to any Gemini profile (compat_api = "gemini", such as ~/.codex/gemini-pool.config.toml) to switch pycodex-ws Web sessions for that profile to the pyagy backend:

  • Optional Context Alignment: When created from pycodex-ws, optional ContextConfig inputs (extra_contextual_user_messages such as Canvas board instructions when enable_board=True and <external_call_context>, include_environment_context, developer_instructions, user_instructions, base_instructions_override, and codex_home/skills when include_skills_instructions=True) are injected dynamically without altering pure CLI wire parity.
  • Disabled ask_question Runtime: ask_question retains its official declaration in tools for 100% wire parity, and immediately returns Encountered error in tool execution: ask_question is disabled when called (without prompting).
  • Web UI Features: Supports /compact, /model, /effort, /cd, live subagent tree (/api/sessions/<id>/agents), background task & subagent tracking (idle: sleeping status and /api/sessions/<id>/background-work), rollout tab persistence, and in-place Reload PyCodex.
  • An idle session shows idle: sleeping while a background command or schedule can wake it, including daemon jobs. Print mode can exit with daemons still pending.
  • Pending one-shot timers and cron jobs store their next deadline, prompt and progress under the conversation’s .system_generated/tasks/. Web rollout restore, --continue and --conversation rearm them. An overdue timer fires on resume. A cron delivers one overdue notification, then continues on its calendar with its remaining iteration budget. Timers created by older versions with only a task log need to be scheduled again. Shell processes end when the session closes.
  • The workspace enables preview_reasoning for pyagy Web views and Feishu cards. Root and subagent previews show the full current reasoning text or summary, including paragraph breaks. The next assistant delta replaces it with the accumulated reply text. Recorded items retain their original roles for Gemini replay.

Verification

See ALIGNMENT.md for the detailed alignment status (unaligned/placeholder items vs verified wire-compatible contracts) against official agy 1.5.14.

env -u VIRTUAL_ENV PYTHONPATH=.:packages/pyagy \
  uv run --dev pytest packages/pyagy/tests

Metadata

Release files for pyagy 0.7.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyagy 0.7.6
File Size Uploaded Provenance Actions
pyagy-0.7.6.tar.gz 96.8 kB With provenance Details for pyagy-0.7.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyagy 0.7.6
File Interpreter ABI Platform Actions
pyagy-0.7.6-py3-none-any.whl Python 3 none any Details for pyagy-0.7.6-py3-none-any.whl

Total release size: 189.9 kB

Release files / pyagy-0.7.6.tar.gz

Download URL pyagy-0.7.6.tar.gz
Size 96.8 kB
Tags Source
SHA-256 checksum
How to use checksums
36608c4b4b1f28e65612db1e6efa12ece78d33352f2247f4ac3c9c7c151ff524
BLAKE2b-256 checksum
How to use checksums
a21fd3cb1b38766de6a2289404c2d95d337c8870698d276ada2baf263405e412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / pyagy-0.7.6-py3-none-any.whl

Download URL pyagy-0.7.6-py3-none-any.whl
Size 93.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a8ddde64f0a53a2c58f04b57ca12be28cca8dd1bfe016d5b65989add8e12232
BLAKE2b-256 checksum
How to use checksums
6d6097ece070431405dbbf591ce044e30e62fc8289e308436f17cf87ebbb6052
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for pyagy 0.7.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyagy-0.7.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page