feat: add live executor observability

This commit is contained in:
liujing
2026-07-17 00:48:52 +08:00
parent 3566a73a03
commit c9d76d8f58
13 changed files with 1546 additions and 28 deletions
+23 -1
View File
@@ -18,7 +18,9 @@ $agent-workflow-host 继续 <run-id>
$agent-workflow-host 查看 <run-id>
$agent-workflow-host 清理后重试 <run-id>
$agent-workflow-host 执行器重试 <run-id>
$agent-workflow-host 执行器重试 <run-id>
$agent-workflow-host 中止 <run-id> 原因:需求变化
$agent-workflow-host 日志 <run-id> [--follow]
```
- Treat an explicit `执行` invocation as authorization to execute the latest clearly bounded plan in the conversation.
@@ -59,12 +61,17 @@ $agent-workflow-host 中止 <run-id> 原因:需求变化
5. Require non-empty repository-relative scope entries and at least one verification command. Use argument arrays; never encode shell pipelines, redirections, glob expansion, `&&`, or `;` as one command.
6. Store input JSON in a `mktemp -d` directory outside the repository. The workflow's durable state is the audit record; remove temporary input files after a terminal result.
7. Start the run and record the emitted run ID:
7. Start the run and record the emitted run ID, then immediately print a logs-follow command the user can run independently:
```bash
agent-workflow start --plan <temp-plan.json> --executor <reasonix|claude|agy>
```
After starting, announce:
```text
Run <run-id> started. Monitor live output: agent-workflow logs --run <run-id> --follow
```
Honor an explicit `max-cycles` argument. Otherwise use project configuration and workflow defaults.
## Drive The State Machine
@@ -78,6 +85,21 @@ Continue until a terminal status. Do not stop after merely proposing a decision.
3. Review for correctness, regressions, security, and missing tests. Assign stable IDs such as `codex-<cycle>-1` to concrete issues.
4. Independently run every `verificationCommands` entry from the repository root and retain concise evidence.
### While waiting for an executor
While `agent-workflow status --run <run-id> --json` reports `status: "executing"`, provide a concise progress update approximately every 20-30 seconds using the `activitySummary` and `executionElapsed` fields from the status JSON or from `agent-workflow status --run <run-id> --json`. Example:
```
Executor has been running for ~2m. Current activity: Editing src/parser.ts (PID 12345).
```
- Do not emit raw JSON, empty heartbeat spam, or repeat identical summaries.
- Mention stage, error summaries, or notable file changes when available.
- Always invite the user to watch live output independently:
```
Watch live: agent-workflow logs --run <run-id> --follow
```
### `awaiting_scope_resolution`
1. Confirm the Codex review bundle was not prepared and inspect every structured `scopeViolations` entry.