Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyxis-harness-agent

会话与运行:跑在 ctx.agentLoop 构建的图之上。

项 值
条目 agents(base bundle)
服务 AgentService,ctx.agents
注入 agentLoop、store
数据 ctx.store:("pyharness", "sessions")、("pyharness", "turns", session_id);ctx.checkpointer:LangGraph thread

文件

文件 内容
__init__.py 公开名称
service.py AgentService、AgentConfig、会话记录的命名空间:会话记录、每个会话的图、运行、重启后的续跑
runs.py 一次运行:RunHandle、Turn、TurnRecorder、SessionBusy、RestartPending、NotContinuable
messages.py 消息内容辅助函数:LangChain 消息的文本、图片、推理;serialize_message:供 API 的序列化
prompts.toml 模型可见的文本

概念

概念 契约
会话 LangGraph thread(ctx.checkpointer)+ 元数据记录(ctx.store)
运行 后台任务;事件写入 RunHandle
订阅者 从头回放;断开连接后运行继续
hold 每个运行持有 lifecycle 的 hold;挂起的重启等待它
拒绝 重启挂起 → AgentService.start_run 抛出 RestartPending
续跑 受 supervisor 管理的一代在 app/started 时:向每个列出的会话发送一条续跑消息
模型 session.model(route:model)以 configurable.model_spec 到达 loop
图 会话的每组(workspace、mode、preset)一张图,首次使用时构建

运行(runs.py)

名称 契约
RunHandle 一次运行的事件日志;每个订阅者从头收到全部事件
Turn agent/turn-start 与 agent/turn-end 的参数
TurnRecorder 一轮的统计与轨迹,取自运行事件与图的 update
SessionBusy 会话有运行中的轮次
NotContinuable 会话的最后一轮不可继续
RestartPending 重启挂起;新运行被拒绝

运行事件

类型:reasoning、token、image、tool_call、tool_result、compact、retry、interrupt、error、done,以及插件经 publish 发布的类型。

类型 契约
compact 压缩检查点取代了较早的历史
compact 的字段 removed、before_tokens、after_tokens、trigger、summary
retry 路由的重试策略重跑失败的模型调用;失败那次已流出的文本作废
retry 的字段 attempt、max_retries、code、message、delay_ms
error 的字段 code(pyxis_harness_llm 的失败代码)、message、continuable
done 的 extras agent/turn-end 的 turn.extras
done 的 extras.turn 新的每轮记录
publish(session_id, event) 把 event 发布到会话正在运行的轮次;没有运行中的轮次时返回 False

审批时限

项 契约
config.approval_timeout 工具审批等待决定的秒数;None(默认):不超时
适用 待处理的中断只有一个工具审批,且其中每个调用都允许 reject
期限 审批发起时刻 + 时限;interrupt 事件的 deadline,approval_deadline(session_id)
到期 一次 kind 为 approval 的运行:每个调用以 prompts.toml 的 approval_timeout 为理由被拒绝,agent 继续
先有决定 会话的下一次运行开始时期限作废
持久化 ctx.store 的 ("pyharness", "approvals"):会话 id → {"deadline"};app/started 时恢复
重启挂起时到期 下一代恢复期限后拒绝
时限关闭后启动 清除留存的期限;待处理的审批继续等待
set_approval_timeout(seconds) 即时生效,作用于此后发起的审批;持久化由 settings API 完成
提问(ask_user_question) 不适用

总线事件

事件 模式 监听者
agent/turn-start parallel (turn: Turn)
agent/turn-end parallel (turn: Turn);turn.outcome 已设置

失败的轮次

项 契约
每轮记录 outcome 为 error 的轮次保留 error: {code, message}
failure(session_id) 该轮是最后一轮时,报告这次失败
retry_run(session_id) 失败代码属于 CONTINUABLE_CODES 时继续这次失败:一次 kind 为 retry 的运行
retry 运行 图从失败的那一步恢复;不加消息

图片

消息 契约
用户消息 文本之外带 image_url 内容块(data URL)
序列化后的消息 图片列在 images 下
带图片块的 AI 消息 发出 image 事件;图片同样列在 images 下

每轮记录

项 契约
范围 每一轮都记录
位置 ctx.store,命名空间 ("pyharness", "turns", session_id),key 为 run id
stats 步骤数、工具调用数、token 用量、llm / tool / ttft / decode 的墙钟时间、时长、压缩次数
records 轨迹:user、step、tool、compact、retry、end
turns(session_id) 列出记录
done 事件 extras.turn:新的记录

提示词(prompts.toml)

项 契约
表名 使用该表的模块名
加载 pyxis_harness.package_prompts;每个字符串值去除首尾空白
占位符 string.Template 语法:${name}

Metadata

Release files for pyxis-harness-agent 0.1.0rc2

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

Source distribution (sdist)

Source distribution for pyxis-harness-agent 0.1.0rc2
File Size Uploaded Provenance Actions
pyxis_harness_agent-0.1.0rc2.tar.gz 15.6 kB Without provenance Details for pyxis_harness_agent-0.1.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyxis-harness-agent 0.1.0rc2
File Interpreter ABI Platform Actions
pyxis_harness_agent-0.1.0rc2-py3-none-any.whl Python 3 none any Details for pyxis_harness_agent-0.1.0rc2-py3-none-any.whl

Total release size: 36.5 kB

Release files / pyxis_harness_agent-0.1.0rc2.tar.gz

Download URL pyxis_harness_agent-0.1.0rc2.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1eebc3591d7aa7eb58e63e90d99452e3d05ab3e1f4552c98dd8a119896117863
BLAKE2b-256 checksum
How to use checksums
18292ea90ded282e4835c59765540f393e1e175b5f5f52cf5d3aed2e2fe0f195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pyxis_harness_agent-0.1.0rc2-py3-none-any.whl

Download URL pyxis_harness_agent-0.1.0rc2-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91a1738e8a81e93de285a420ac92324f022961e7dd5ee68af4ca1d29253fde79
BLAKE2b-256 checksum
How to use checksums
26e4ddf546e830899fe66e533aa8b36e5bfa609d2bb674909c62a0ffe46ac18e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pyxis-harness-agent 0.1.0rc2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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