Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7388fb7
feat(engine,harness,render): multi-action support + action runtime fixes
ravenSanstete Jun 26, 2026
5452e23
feat: expose reasoning_content from API response to TUI
ravenSanstete Jun 27, 2026
5a2f8f0
fix: show model content text alongside tool_calls in TUI
ravenSanstete Jun 27, 2026
707979f
feat(tui): display task instruction at run start
ravenSanstete Jun 27, 2026
6379f25
fix: parse :param descriptions from docstrings into tool schema
ravenSanstete Jun 27, 2026
af3cc55
feat(tui): render CallChain gates and task memory in TUI
ravenSanstete Jun 27, 2026
17024e5
feat(tui): constraint board + task memory render with LLM-identical text
ravenSanstete Jun 27, 2026
11a8f8a
fix(tui): pass live state object to _state_stats for constraint board
ravenSanstete Jun 27, 2026
c47ab75
feat(cybergym): sync latest agent with vul-only partial-hit refinemen…
ravenSanstete Jun 28, 2026
da0aa73
feat(cybergym): sync latest agent with constraint discovery accelerat…
ravenSanstete Jun 29, 2026
85a8099
feat: qita CLI updates, workspace tool improvements, docs refresh
ravenSanstete Jun 29, 2026
71bb4e1
fix(render): deduplicate thinking text when reasoning_content equals …
ravenSanstete Jun 29, 2026
d2ee976
feat: per-task TUI log file for offline trajectory analysis
ravenSanstete Jun 29, 2026
7ac49ed
chore(cybergym): sync vendored agent to cybergym_agent@6dff2cc
Xulichenpro Jun 30, 2026
84d56b2
feat(cybergym): optional per-task Docker env + fix DockerEnv abs-path…
Xulichenpro Jun 30, 2026
c1c445f
chore(cybergym): sync vendored agent to cybergym_agent@4b4fc88 (oracl…
Xulichenpro Jun 30, 2026
64207ef
fix: add __init__.py to repo root to prevent namespace package shadowing
ravenSanstete Jul 1, 2026
d4c816e
Revert "fix: add __init__.py to repo root to prevent namespace packag…
ravenSanstete Jul 1, 2026
0e5df2b
sync: cybergym agent V11 — active sink discovery optimizations
ravenSanstete Jul 2, 2026
147468f
diag: add traceback.print_exc() to engine exception handlers
ravenSanstete Jul 2, 2026
d9596e4
fix: add file-based error logging for unrecoverable_error debugging
ravenSanstete Jul 2, 2026
39f423f
fix: surface recovered runtime exceptions
ravenSanstete Jul 2, 2026
70239a0
fix: render Sink Candidates + Objective in TUI alongside Constraint B…
ravenSanstete Jul 2, 2026
b673948
feat: TUI completeness — phase cache, task context, allowed tools ren…
ravenSanstete Jul 2, 2026
8400678
feat: TUI rendering for suggested sinks + auto-discovery tags
ravenSanstete Jul 2, 2026
c01587e
fix: remove truncation of tool call results in TUI output
ravenSanstete Jul 2, 2026
8204310
sync: agent v19 with no Point access + vuln patterns + auto-discovery
ravenSanstete Jul 2, 2026
ecd817d
DockerEnv: add container_env param + runner passes CYBERGYM vars to c…
ravenSanstete Jul 5, 2026
3cbbedb
v14: TUI completeness, runtime contract fixes, GDB tool improvements
ravenSanstete Jul 6, 2026
c5b80ee
Sync cybergym_agent v15: knowledge packs, observation contract, dynam…
ravenSanstete Jul 6, 2026
8578790
Sync cybergym_agent v16: remove run_candidate, fix gdb=false, sanitiz…
ravenSanstete Jul 7, 2026
5e013e9
Add x-inspire-inference-key sticky routing for LLM requests
ravenSanstete Jul 7, 2026
d16e775
Add inference_key sticky routing for CyberGym LLM requests
ravenSanstete Jul 8, 2026
e37540f
Fix task_id display and Action rendering in TUI
ravenSanstete Jul 8, 2026
42a91ff
Sync cybergym_agent: knowledge packs, observation, recipe IR, bug fixes
ravenSanstete Jul 8, 2026
a02e96c
Sync cybergym_agent v19-next: submit_tool fix, pack taxonomy, observa…
ravenSanstete Jul 8, 2026
c6e8fc0
Sync cybergym_agent v19-nb: Constraint Board sink_id fix, remove obso…
ravenSanstete Jul 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ examples/qitos_tau_workspace/
qitos_cybench_workspace/
examples/qitos_cybench_workspace/
examples/playground/
qitos/benchmark/cybergym/agent/

# API secrets (never push)
api_info.md
Expand Down
1,323 changes: 1,323 additions & 0 deletions .playwright-cli/page-2026-06-26T15-36-33-512Z.yml

Large diffs are not rendered by default.

641 changes: 641 additions & 0 deletions .playwright-cli/page-2026-06-26T15-40-23-173Z.yml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ How to update:
### Added

- Added `AgentSpec.tool_name` so delegate workers can expose task-oriented model-facing tool names while keeping the registry agent name stable.
- Added qita's trajectory analysis workbench with diagnosis-first run pages, derived failure insights, focus navigation, critical-step guidance, an inspector panel, and expandable full-content evidence views for long thoughts, observations, parser diagnostics, actions, and critic outputs.
- Added qita `step_interactions`, a derived action-observation view that pairs each action with its complete arguments, invocation metadata, model-visible result, and canonical raw result while separating environment-only and unmatched evidence.
- Added a qita light/dark theme system with a persistent toolbar toggle across board, run detail, replay, and comparison pages.

### Changed

- Strengthened the CyberGym PoC agent's task bootstrap with lightweight structured task-spec extraction and more relevant repo evidence ranking.
- Clarified candidate provenance and lightweight failure taxonomy handling in the CyberGym agent without changing its single-agent runtime architecture.
- Improved qita diagnostics for CyberGym-style traces so budget stops are marked as review-needed, `submit_poc` verification failures are promoted as critical inspection steps, and low-frequency metadata stays out of the default attention path.
- Redesigned qita step stories around `Input -> Thought -> Action Calls -> Environment Observation`: multi-action calls now render as numbered paired units with status, latency, parameters, and their own result; failed calls expand by default, successful calls fold, and all long evidence remains available in wrapped, copyable code views and call-aware Inspector tabs.

### Fixed

- Fixed `DelegateTool` context delivery so the optional tool-call `context` object is passed into the child agent via `Engine.run(..., context=...)`.
- Fixed CyberGym OpenAI-compatible model routing so each agent run gets a unique sticky inference key instead of relying on process-global routing state.
- Fixed OpenAI-compatible tool schema generation for postponed or string annotations so CyberGym tools no longer emit invalid JSON Schema types.
- Fixed CyberGym batch trace/result/render redaction so API keys and auth token markers are scrubbed before persisted artifacts are written.
- Fixed CyberGym PoC generation runs so benchmark-local Bash commands can run without interactive command review while the default coding toolset review guard remains intact.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ QitOS core is the small framework. Product-grade applications and showcase agent

## What's New

- **qita trajectory workbench**: Run pages now open in a diagnosis-first view with a Focus Navigator, Agent Behavior Story, and right-side Inspector. Each step follows `Input -> Thought -> Action Calls -> Environment Observation`; every action is paired with its complete parameters, status, latency, and model-visible result, while canonical raw and unmatched evidence stays auditable in the Inspector. Failed calls expand by default, successful calls fold, and long content is wrapped and never available only as a truncated preview. CyberGym budget stops and `submit_poc` verification failures are promoted as review targets. Persistent light/dark themes cover board, run, replay, and compare pages.
- **Cleaner delegate tools**: `AgentSpec.tool_name` lets multi-agent systems expose task-oriented tool names, and `DelegateTool` now delivers structured `context` payloads into child agents.
- **CyberGym integration hardening**: v0.6 integration runs now preserve valid OpenAI-compatible tool schemas, redact persisted secrets across traces/results/render artifacts, and keep CyberGym PoC-generation shell commands out of the interactive review path while preserving the default coding-tool guard.
- **Lighter-weight CyberGym bootstrap guidance**: the CyberGym PoC agent now derives a compact task-spec summary, ranks likely parser/harness/sample paths more aggressively, tracks richer candidate provenance, and records a lightweight internal failure taxonomy without changing the single-agent runtime.
Expand Down
4 changes: 4 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ QitOS 主仓库是小而清晰的核心框架。产品级 / 展示级应用会

[快速开始](https://qitor.mintlify.app/zh/quickstart) · [教程课程](https://qitor.mintlify.app/zh/tutorials) · [基准测试](https://qitor.mintlify.app/zh/benchmarks/overview) · [CLI 参考](https://qitor.mintlify.app/zh/reference/cli) · [更新日志](CHANGELOG.md) · [English README](README.md)

## 最新进展

- **qita 轨迹分析工作台**:run 页面现在默认进入失败诊断视图,用 Focus Navigator、Agent Behavior Story 和右侧 Inspector 引导用户先看关键证据。每步按照 `Input -> Thought -> Action Calls -> Environment Observation` 展示;每个 action 都和自己的完整参数、状态、耗时及 model-visible result 成对出现,canonical raw 与无法配对的证据仍可在 Inspector 审计。异常调用默认展开、成功调用默认折叠,长正文自动折行且绝不会只有截断预览。CyberGym 的预算耗尽和 `submit_poc` 验证失败会被提升为重点复盘信号;Light/Dark 主题覆盖 board、run、replay 与 compare 页面。

## v0.5.0 最新进展

- **12 个方法模板**:ReAct、PlanAct、SWE-Agent、Voyager、Debate、Manager-Worker、Planner-Executor、Self-Refine、Reflexion、LATS、MoA 和 Magentic-One — 每个都包含 paper.md、config.yaml 和 recipe 实现。
Expand Down
7 changes: 7 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Re-export from the real qitos sub-package.

This directory is the qitos git repo root. The actual Python package
lives in the ``qitos/`` sub-directory below. Without this file, Python
treats this as a namespace package and shadows the pip-installed qitos.
"""
from .qitos import * # noqa: F401,F403
20 changes: 19 additions & 1 deletion docs/benchmarks/cybergym.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,25 @@ OpenAI-compatible harness presets now default to:

This is handled in the shared OpenAI-compatible model layer rather than only in the benchmark wrapper.

### 3. Tool-result budget
### 3. Run-level inference sticky routing

CyberGym agent runs generate a run-unique inference `task_id` such as:

```text
cybergym-arvo-3938-<run-uuid>
```

QitOS sends this value on every OpenAI-compatible model request as:

```text
x-inspire-inference-key: <inference task_id>
```

This keeps all LLM requests for one agent run routed to the same upstream backend node while allowing repeated runs of the same CyberGym benchmark task to spread across nodes. The CyberGym benchmark `task_id` used for `submit_poc` and checksum validation is not changed. The generated inference `task_id` is printed near the start of the TUI and `tui.log` agent-composition block.

For non-CyberGym callers, `QITOS_INFERENCE_KEY` remains a compatibility fallback when no model-level `inference_key` is provided.

### 4. Tool-result budget

CyberGym benchmark runs use a larger tool-result budget than the generic engine default.

Expand Down
40 changes: 29 additions & 11 deletions docs/guides/observability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,42 @@ Click **view** on any run card to open the run detail page. The page has two tab

**Traj tab**

The trajectory (the ordered sequence of steps the agent took) view shows every step as a card with five collapsible sections:
The trajectory (the ordered sequence of steps the agent took) view opens as a failure-diagnosis workbench. The first viewport includes:

- **State** — scalar fields from the observation output
- **Thought** -- the model's rationale (from `decision.rationale` or parsed `Thought:` line)
- **Action** -- the tool call that was dispatched based on the decision
- **Direct Observation** -- action results (the data returned after the tool executes); search hits render as a table, errors are highlighted
- **Critic** -- critic (a step-level validator) output (`action`, `reason`, `score`) if critics were attached
- **Trace Events** — raw `RuntimeEvent` list for the step (collapsed by default)
- **Diagnosis Strip** — outcome, primary failure, next step to inspect, and trace-derived risk flags
- **Focus Navigator** — defaults to critical steps, submissions, errors, and phase changes, with an `All Steps` mode when you want the full trajectory
- **Agent Behavior Story** — step cards organized as a causal `Input -> Thought -> Action Calls -> Environment Observation` chain
- **Inspector** — a sticky right-side panel with step-level tabs and call-level Summary, Params, Result, and Raw tabs
- **Run Metadata** — config, cost, context, parser, critic, and raw telemetry are folded away by default so they do not compete with the diagnostic path

The **Step Navigator** sidebar lets you jump to any step. Use the controls to:
Each default step card is intentionally sparse:

- **Role / phase** — why this step matters in the run narrative
- **Input** — the complete prepared input delivered to the model, folded by default
- **Thought** — the recorded rationale in an independent folded evidence block
- **Action Calls** — numbered action controls followed by one paired unit per call, containing its parameters, execution status, latency, attempts, and corresponding result
- **Environment Observation** — environment-only results in a separate, visually quieter folded lane so they are not mistaken for tool results
- **Evidence links** — jump points for full thought/action/observation/parser/critic/raw evidence in the Inspector

Input prefers the current step's `model_input.prepared_full`, then `prepared`, and falls back to the recorded step observation for older traces. Each evidence block shows its source and complete character count; expanded code views preserve every recorded character, newline, and field, wrap long lines inside the available width, and support copying the complete unmodified text.

For each action call, qita prefers an explicit `action_id` when pairing results. Standard QitOS traces without IDs use the Engine's original action/result order. The call's Result view uses `observation_ready.action_results`, which is what the agent could observe, while the Inspector Raw view also preserves canonical `step.action_results`. Environment-only results are separated before pairing. Extra actions or results are shown as **Unmatched evidence** rather than assigned speculatively.

The run API exposes this derived view as optional `step_interactions`. It is a qita presentation model, not a new stable core trace schema; `manifest.json`, `events.jsonl`, and `steps.jsonl` remain unchanged.

Numbered call badges select and locate calls without hiding repeated tool names. Failed, blocked, `NO_TRIGGER`, and submission-error calls expand automatically; successful and verified calls stay folded until needed. On narrow screens, the causal chain and Inspector stack vertically without horizontal page overflow.

Long evidence is not truncated as the only available view. qita uses short status labels for scanning, then keeps the full input, thought, raw model output, action parameters, tool results, environment observations, terminal output, parser diagnostics, critic output, and raw JSON in expandable scrollable detail blocks.

The **Focus Navigator** sidebar lets you jump to important steps and shows small health markers for parser errors, tool/event errors, critic retries/stops, context pressure, CyberGym PoC submissions, and visual evidence. Use the controls to:
- Filter by text across all step content
- Filter by event phase
- Sort steps ascending or descending
- Toggle observation and critic sections
- Fold or expand all sections at once
- Switch between critical/submission/error/phase/all-step views
- Adjust font size with `A-` / `A` / `A+`
- Toggle between light and dark qita themes; the choice is saved in the browser and applies to board, run detail, replay, and comparison pages

A gantt-like **phase timeline** at the top of the traj view shows phase durations for each step as color-coded segments.
Click a navigator item, timeline row, or story card to synchronize the Inspector with that step. Click a numbered action badge or call unit to switch the Inspector into call mode, where **Params** and **Result** show complete wrapped evidence and **Raw** keeps action, invocation, model-visible result, and canonical raw result together.

**Manifest tab**

Expand Down
1 change: 1 addition & 0 deletions docs/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ When a `Task` object is passed to `Engine.run()`, the `Task.budget` values overr
|----------|----------|-------------|
| `OPENAI_API_KEY` | Yes (for OpenAI / compatible APIs) | API key sent in the `Authorization` header. Used by `OpenAIModel` and `OpenAICompatibleModel` |
| `OPENAI_BASE_URL` | Yes (for compatible APIs) | Base URL of the API endpoint. Required by `OpenAICompatibleModel`; optional for `OpenAIModel` (defaults to `https://api.openai.com/v1`) |
| `QITOS_INFERENCE_KEY` | No | Compatibility fallback for OpenAI-compatible sticky routing. When a model instance does not set `inference_key`, this value is sent as `x-inspire-inference-key` |
| `QITOS_API_KEY` | No | Alternative API key variable. Recognized by `ModelFactory.from_env()` as a fallback when `OPENAI_API_KEY` is not set |
| `QITOS_MODEL` | No | Default model identifier. Read by `ModelFactory.from_env()` to select the model when none is specified in code |
| `AZURE_OPENAI_API_KEY` | Only for Azure | API key for Azure OpenAI. Used by `AzureOpenAIModel` |
Expand Down
6 changes: 4 additions & 2 deletions docs/reference/kit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,8 @@ def __init__(
system_prompt: Optional[str] = None,
temperature: float = 0.7,
max_tokens: int = 2048,
timeout: int = 60,
timeout: int = 120,
inference_key: Optional[str] = None,
)
```

Expand All @@ -940,7 +941,8 @@ def __init__(
| `system_prompt` | `None` | Prepended as a system message to every call |
| `temperature` | `0.7` | Sampling temperature |
| `max_tokens` | `2048` | Maximum tokens in the response |
| `timeout` | `60` | Request timeout in seconds |
| `timeout` | `120` | Request timeout in seconds |
| `inference_key` | `None` | Optional sticky-routing key sent as `x-inspire-inference-key`; falls back to `QITOS_INFERENCE_KEY` when unset |

**Usage**

Expand Down
17 changes: 17 additions & 0 deletions docs/zh/benchmarks/cybergym.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,29 @@ python scripts/verify_batch_results.py \
qita board --logdir runs/cybergym/traces
```

批量脚本 `scripts/run_cybergym_batch.py` 会把每个任务的 trace 写到
`<out-root>/traces/<run_id>/`,因此 `qita board --logdir` 应该指向
`<out-root>/traces`,而不是 JSONL 结果文件或 batch 根目录。如果你直接运行 QitOS
同级目录里的 `../cybergym_agent` 本地入口,它也可能把 trace 写到
`../cybergym_agent/runs/<run_id>/`;这种情况下把 `--logdir` 指向
`../cybergym_agent/runs` 即可。

QitOS 追踪记录会写出:

- `manifest.json`
- `events.jsonl`
- `steps.jsonl`

qita 会按这三份标准文件派生运行诊断。对于 CyberGym PoC 轨迹,详情页默认进入失败诊断视图:

- `budget_steps`、`budget_time` 会显示为需要复盘,而不是成功。
- `submit_poc`、`verification_history`、`failure_history` 会生成 PoC attempt ladder。
- `no_trigger`、`submission_error`、`connection refused`、server connectivity 失败会显示为不同 failure category。
- Focus Navigator 默认只列关键步骤、提交步骤、错误步骤与阶段变化;完整 step、prompt metadata、trace events、raw JSON 仍可在 Inspector 中展开。
- 每步按照 `Input -> Thought -> Action Calls -> Environment Observation` 展示。Input 优先读取 `model_input.prepared_full`;每个 Action Call 以 `action_id` 或 Engine 原始顺序配对自己的完整参数、状态、耗时和 model-visible `observation_ready.action_results`,canonical `step.action_results` 留在 Inspector Raw 中。
- 多个同名 `submit_poc` 仍以序号区分并分别对应各自 PoC path 与验证结果;环境专属 result 单独展示,无法可靠配对的 action/result 明确进入 Unmatched evidence,不会猜测关系。
- 异常调用默认展开,成功调用、Input 和 Environment Observation 默认折叠。参数、terminal output、observation 与 raw JSON 全部自动折行、可复制并保留完整正文,不做不可恢复的截断。

## 当前状态

这次集成已经验证了:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sessionId":"30960358-6e1e-42bb-846e-422b17d25a00","pid":14560,"acquiredAt":1782914398024}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sessionId":"30960358-6e1e-42bb-846e-422b17d25a00","pid":14560,"acquiredAt":1782914398024}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
*.egg-info/
*.egg
dist/
build/
.eggs/

# Virtual environments
venv/
.venv/
env/

# IDE
.idea/
.vscode/
*.swp
*.swo
*~
.DS_Store
.worktrees/

# CyberGym agent runtime artifacts
.agent/
.cybergym/
render_events.jsonl
runs/

# Temp files from task execution
poc_*
*.tar.gz

# Environment and secrets
.env
.env.local

# Test artifacts
.pytest_cache/
.coverage
htmlcov/

# MyPy
.mypy_cache/

# Vendored qitos build/runtime artifacts (source is tracked)
qitos/__pycache__/
qitos/*.egg-info/
qitos/qitos.egg-info/
qitos/qitos_zoo/
qitos/qitos/benchmark/cybergym/agent/runs/
qitos/qitos/benchmark/cybergym/agent/.agent/
qitos/qitos/benchmark/cybergym/agent/.cybergym/
Loading
Loading