-
Notifications
You must be signed in to change notification settings - Fork 52
Reliability hardening (#892–#895) + readable agents:logs #914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
422274a
Fix relay reliability delivery events
4cf799b
Fix delivery retry review gaps
9252ae4
Cook agent log output by default
aba4ad5
Harden agents logs byte handling
b013897
Merge branch 'fix/reliability-892-895' into combined/reliability-and-…
2fe5c03
Merge branch 'fix/agents-logs-readable' into combined/reliability-and…
e8f7e61
style: auto-format Rust code with cargo fmt
github-actions[bot] d3cca79
Fix delivery terminal reliability review findings
0838b8d
Fix PR914 review follow-ups
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| { | ||
| "id": "traj_5nzj6v56id4z", | ||
| "version": 1, | ||
| "task": { | ||
| "title": "Fix PR914 review comments" | ||
| }, | ||
| "status": "completed", | ||
| "startedAt": "2026-05-19T13:20:42.407Z", | ||
| "completedAt": "2026-05-19T13:26:28.697Z", | ||
| "agents": [ | ||
| { | ||
| "name": "default", | ||
| "role": "lead", | ||
| "joinedAt": "2026-05-19T13:24:02.083Z" | ||
| } | ||
| ], | ||
| "chapters": [ | ||
| { | ||
| "id": "chap_j8u0dnm0wppl", | ||
| "title": "Work", | ||
| "agentName": "default", | ||
| "startedAt": "2026-05-19T13:24:02.083Z", | ||
| "endedAt": "2026-05-19T13:26:28.697Z", | ||
| "events": [ | ||
| { | ||
| "ts": 1779197042084, | ||
| "type": "decision", | ||
| "content": "Use file-descriptor scoped reads for CLI log windows: Use file-descriptor scoped reads for CLI log windows", | ||
| "raw": { | ||
| "question": "Use file-descriptor scoped reads for CLI log windows", | ||
| "chosen": "Use file-descriptor scoped reads for CLI log windows", | ||
| "alternatives": [], | ||
| "reasoning": "CodeQL flagged stat-then-open TOCTOU; opening once and using fstat/read on that descriptor preserves byte-window semantics while removing path re-resolution between size and read." | ||
| }, | ||
| "significance": "high" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "retrospective": { | ||
| "summary": "Fixed PR914 review comments: descriptor-scoped CLI log tail reads, blocked-on-send last-activity refresh, and regression coverage for default log tail helpers.", | ||
| "approach": "Standard approach", | ||
| "confidence": 0.93 | ||
| }, | ||
| "commits": [], | ||
| "filesChanged": [ | ||
| ".trajectories/index.json", | ||
| ".trajectories/completed/2026-05/traj_5nzj6v56id4z.json", | ||
| "crates/broker/src/runtime/worker_events.rs", | ||
| "src/cli/commands/agent-management.test.ts", | ||
| "src/cli/commands/agent-management.ts" | ||
| ], | ||
| "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relay", | ||
| "tags": [], | ||
| "_trace": { | ||
| "startRef": "d186133ca50bdf24cceead6d728472de107da5bd", | ||
| "endRef": "d3cca79bde317bcd7631651e86c37f0d3ac8af33", | ||
| "traceId": "cfbeca77-3301-4e65-8060-ef5ab966fe9a" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| { | ||
| "id": "traj_81kobstnzzwk", | ||
| "version": 1, | ||
| "task": { | ||
| "title": "Orchestrate team review cycle for #892 #893 #894 #895" | ||
| }, | ||
| "status": "completed", | ||
| "startedAt": "2026-05-19T08:16:32.762Z", | ||
| "completedAt": "2026-05-19T08:37:32.966Z", | ||
| "agents": [ | ||
| { | ||
| "name": "default", | ||
| "role": "lead", | ||
| "joinedAt": "2026-05-19T08:26:35.160Z" | ||
| } | ||
| ], | ||
| "chapters": [ | ||
| { | ||
| "id": "chap_0wjk79xtmt0m", | ||
| "title": "Work", | ||
| "agentName": "default", | ||
| "startedAt": "2026-05-19T08:26:35.160Z", | ||
| "endedAt": "2026-05-19T08:37:32.966Z", | ||
| "events": [ | ||
| { | ||
| "ts": 1779179195161, | ||
| "type": "decision", | ||
| "content": "Bound delivery retries and keep pending until terminal confirmation: Bound delivery retries and keep pending until terminal confirmation", | ||
| "raw": { | ||
| "question": "Bound delivery retries and keep pending until terminal confirmation", | ||
| "chosen": "Bound delivery retries and keep pending until terminal confirmation", | ||
| "alternatives": [], | ||
| "reasoning": "#892/#894 require delivery attempts to surface as confirmed/failed and watchdog state to distinguish idle from blocked-on-send; keeping pending deliveries until ack/verified/failed gives status, doctor, and lifecycle events one source of truth." | ||
| }, | ||
| "significance": "high" | ||
| }, | ||
| { | ||
| "ts": 1779179806306, | ||
| "type": "reflection", | ||
| "content": "Coordinated the worker implementation, review, and signoff loop for the reliability work. This orchestration trajectory records team coordination and skill/lockfile maintenance, not the broker or SDK code changes themselves.", | ||
| "raw": { | ||
| "confidence": 0.86 | ||
| }, | ||
| "significance": "high", | ||
| "tags": ["confidence:0.86"] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "retrospective": { | ||
| "summary": "Orchestrated worker/reviewer/signoff coordination for reliability issues #892-#895; direct files changed in this trajectory were skills and lockfiles only.", | ||
| "approach": "Coordinated implementation and review agents while maintaining Agent Relay skill metadata.", | ||
| "confidence": 0.86 | ||
| }, | ||
| "commits": [], | ||
| "filesChanged": [ | ||
| ".agents/skills/review-fix-signoff-loop/SKILL.md", | ||
| ".agents/skills/running-headless-orchestrator/SKILL.md", | ||
| ".agents/skills/setting-up-relayfile/SKILL.md", | ||
| ".agents/skills/using-agent-relay/SKILL.md", | ||
| ".agents/skills/writing-agent-relay-workflows/SKILL.md", | ||
| ".claude/skills/orchestrating-agent-relay/SKILL.md", | ||
| ".claude/skills/review-fix-signoff-loop/SKILL.md", | ||
| ".claude/skills/running-headless-orchestrator/SKILL.md", | ||
| ".claude/skills/setting-up-relayfile/SKILL.md", | ||
| ".claude/skills/using-agent-relay/SKILL.md", | ||
| ".claude/skills/writing-agent-relay-workflows/SKILL.md", | ||
| "package-lock.json", | ||
| "prpm.json", | ||
| "prpm.lock" | ||
| ], | ||
| "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relay", | ||
| "tags": [], | ||
| "_trace": { | ||
| "startRef": "45c8498bc8b83ea8a5cb465df1798869bbcd2c85", | ||
| "endRef": "26ba9fc131badc221ff231a5a2633758f30a0428", | ||
| "traceId": "509f2b77-2b1d-44ae-88c7-a0793a4195f5" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| { | ||
| "id": "traj_e1b7ww3un1u3", | ||
| "version": 1, | ||
| "task": { | ||
| "title": "Harden agents logs raw and follow output" | ||
| }, | ||
| "status": "completed", | ||
| "startedAt": "2026-05-19T10:59:00.118Z", | ||
| "completedAt": "2026-05-19T11:04:44.466Z", | ||
| "agents": [ | ||
| { | ||
| "name": "default", | ||
| "role": "lead", | ||
| "joinedAt": "2026-05-19T11:03:09.871Z" | ||
| } | ||
| ], | ||
| "chapters": [ | ||
| { | ||
| "id": "chap_rj3r8z5el0ux", | ||
| "title": "Work", | ||
| "agentName": "default", | ||
| "startedAt": "2026-05-19T11:03:09.871Z", | ||
| "endedAt": "2026-05-19T11:04:44.466Z", | ||
| "events": [ | ||
| { | ||
| "ts": 1779188589872, | ||
| "type": "decision", | ||
| "content": "Use Buffer reads for raw agents logs and stream byte chunks through cooked follow: Use Buffer reads for raw agents logs and stream byte chunks through cooked follow", | ||
| "raw": { | ||
| "question": "Use Buffer reads for raw agents logs and stream byte chunks through cooked follow", | ||
| "chosen": "Use Buffer reads for raw agents logs and stream byte chunks through cooked follow", | ||
| "alternatives": [], | ||
| "reasoning": "Raw output must avoid UTF-8 decoding entirely, while cooked follow needs TextDecoder streaming so multibyte codepoints split by polling are reconstructed before ANSI replay" | ||
| }, | ||
| "significance": "high" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "retrospective": { | ||
| "summary": "Hardened agents:logs raw output to write Buffer bytes unchanged and made cooked follow preserve split ANSI CSI and UTF-8 sequences across poll chunks", | ||
| "approach": "Standard approach", | ||
| "confidence": 0.92 | ||
| }, | ||
| "commits": [], | ||
| "filesChanged": [], | ||
| "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relay", | ||
| "tags": [], | ||
| "_trace": { | ||
| "startRef": "9252ae4ea526d039517922fa196e3ce39b18c834", | ||
| "endRef": "9252ae4ea526d039517922fa196e3ce39b18c834" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Trajectory: Harden agents logs raw and follow output | ||
|
|
||
| > **Status:** ✅ Completed | ||
| > **Confidence:** 92% | ||
| > **Started:** May 19, 2026 at 12:59 PM | ||
| > **Completed:** May 19, 2026 at 01:04 PM | ||
|
|
||
| --- | ||
|
|
||
| ## Summary | ||
|
|
||
| Hardened agents:logs raw output to write Buffer bytes unchanged and made cooked follow preserve split ANSI CSI and UTF-8 sequences across poll chunks | ||
|
|
||
| **Approach:** Standard approach | ||
|
|
||
| --- | ||
|
|
||
| ## Key Decisions | ||
|
|
||
| ### Use Buffer reads for raw agents logs and stream byte chunks through cooked follow | ||
|
|
||
| - **Chose:** Use Buffer reads for raw agents logs and stream byte chunks through cooked follow | ||
| - **Reasoning:** Raw output must avoid UTF-8 decoding entirely, while cooked follow needs TextDecoder streaming so multibyte codepoints split by polling are reconstructed before ANSI replay | ||
|
|
||
| --- | ||
|
|
||
| ## Chapters | ||
|
|
||
| ### 1. Work | ||
|
|
||
| _Agent: default_ | ||
|
|
||
| - Use Buffer reads for raw agents logs and stream byte chunks through cooked follow: Use Buffer reads for raw agents logs and stream byte chunks through cooked follow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| { | ||
| "id": "traj_f1iac9ngymlj", | ||
| "version": 1, | ||
| "task": { | ||
| "title": "Fix reliability review findings 892-895" | ||
| }, | ||
| "status": "completed", | ||
| "startedAt": "2026-05-19T09:52:54.932Z", | ||
| "completedAt": "2026-05-19T10:01:19.068Z", | ||
| "agents": [ | ||
| { | ||
| "name": "default", | ||
| "role": "lead", | ||
| "joinedAt": "2026-05-19T09:56:49.151Z" | ||
| } | ||
| ], | ||
| "chapters": [ | ||
| { | ||
| "id": "chap_xk1tcoquib82", | ||
| "title": "Work", | ||
| "agentName": "default", | ||
| "startedAt": "2026-05-19T09:56:49.151Z", | ||
| "endedAt": "2026-05-19T10:01:19.068Z", | ||
| "events": [ | ||
| { | ||
| "ts": 1779184609156, | ||
| "type": "decision", | ||
| "content": "Covered #892 transient blip with present worker: Covered #892 transient blip with present worker", | ||
| "raw": { | ||
| "question": "Covered #892 transient blip with present worker", | ||
| "chosen": "Covered #892 transient blip with present worker", | ||
| "alternatives": [], | ||
| "reasoning": "The new regression keeps the worker in the registry, kills its process to make every deliver write fail, loops retry_pending_delivery to MAX_DELIVERY_RETRIES, then asserts the typed message_delivery_failed frame arrives on sdk_out_tx." | ||
| }, | ||
| "significance": "high" | ||
| }, | ||
| { | ||
| "ts": 1779184712770, | ||
| "type": "reflection", | ||
| "content": "Focused #892 regression is green; production event emission now uses typed BrokerEvent variants and retry deferral is scoped to worker queue/verification windows.", | ||
| "raw": { | ||
| "confidence": 0.8 | ||
| }, | ||
| "significance": "high", | ||
| "tags": ["confidence:0.8"] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "retrospective": { | ||
| "summary": "Fixed #892 transient delivery blip coverage and tightened delivery event/state handling from the reliability review", | ||
| "approach": "Standard approach", | ||
| "confidence": 0.9 | ||
| }, | ||
| "commits": [], | ||
| "filesChanged": [], | ||
| "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relay", | ||
| "tags": [], | ||
| "_trace": { | ||
| "startRef": "422274a461b9d922843cfb489810add669b9d13a", | ||
| "endRef": "422274a461b9d922843cfb489810add669b9d13a" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Trajectory: Fix reliability review findings 892-895 | ||
|
|
||
| > **Status:** ✅ Completed | ||
| > **Confidence:** 90% | ||
| > **Started:** May 19, 2026 at 11:52 AM | ||
| > **Completed:** May 19, 2026 at 12:01 PM | ||
|
|
||
| --- | ||
|
|
||
| ## Summary | ||
|
|
||
| Fixed #892 transient delivery blip coverage and tightened delivery event/state handling from the reliability review | ||
|
|
||
| **Approach:** Standard approach | ||
|
|
||
| --- | ||
|
|
||
| ## Key Decisions | ||
|
|
||
| ### Covered #892 transient blip with present worker | ||
|
|
||
| - **Chose:** Covered #892 transient blip with present worker | ||
| - **Reasoning:** The new regression keeps the worker in the registry, kills its process to make every deliver write fail, loops retry_pending_delivery to MAX_DELIVERY_RETRIES, then asserts the typed message_delivery_failed frame arrives on sdk_out_tx. | ||
|
|
||
| --- | ||
|
|
||
| ## Chapters | ||
|
|
||
| ### 1. Work | ||
|
|
||
| _Agent: default_ | ||
|
|
||
| - Covered #892 transient blip with present worker: Covered #892 transient blip with present worker | ||
| - Focused #892 regression is green; production event emission now uses typed BrokerEvent variants and retry deferral is scoped to worker queue/verification windows. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| { | ||
| "id": "traj_irafiyk6wpw0", | ||
| "version": 1, | ||
| "task": { | ||
| "title": "Fix agents:logs near-unparseable TTY redraw garbage (codex implement, claude review)" | ||
| }, | ||
| "status": "completed", | ||
| "startedAt": "2026-05-19T10:30:38.222Z", | ||
| "completedAt": "2026-05-19T10:44:24.757Z", | ||
| "agents": [ | ||
| { | ||
| "name": "default", | ||
| "role": "lead", | ||
| "joinedAt": "2026-05-19T10:34:18.265Z" | ||
| } | ||
| ], | ||
| "chapters": [ | ||
| { | ||
| "id": "chap_celobruq6ana", | ||
| "title": "Work", | ||
| "agentName": "default", | ||
| "startedAt": "2026-05-19T10:34:18.265Z", | ||
| "endedAt": "2026-05-19T10:44:24.757Z", | ||
| "events": [ | ||
| { | ||
| "ts": 1779186858266, | ||
| "type": "decision", | ||
| "content": "Cook agents:logs in the CLI with a small ANSI/VT replay helper: Cook agents:logs in the CLI with a small ANSI/VT replay helper", | ||
| "raw": { | ||
| "question": "Cook agents:logs in the CLI with a small ANSI/VT replay helper", | ||
| "chosen": "Cook agents:logs in the CLI with a small ANSI/VT replay helper", | ||
| "alternatives": [], | ||
| "reasoning": "The broker and workflow runner intentionally persist raw PTY bytes for dashboard/xterm debugging. The CLI can convert that stream to line-oriented output by replaying cursor positioning and clears; this avoids adding a terminal dependency and preserves --raw for exact diagnostics." | ||
| }, | ||
| "significance": "high" | ||
| }, | ||
| { | ||
| "ts": 1779187442268, | ||
| "type": "reflection", | ||
| "content": "Implemented CLI-side PTY cooking with raw opt-out; focused tests, typecheck, and build are green after a final rerun", | ||
| "raw": { | ||
| "confidence": 0.9 | ||
| }, | ||
| "significance": "high", | ||
| "tags": ["confidence:0.9"] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "retrospective": { | ||
| "summary": "Made agents:logs cook raw PTY redraws into line-oriented output by default, added --raw for exact terminal bytes, covered cursor-redraw and raw-mode regressions, and validated with targeted Vitest, typecheck, build, and a compiled before/after sample.", | ||
| "approach": "Standard approach", | ||
| "confidence": 0.9 | ||
| }, | ||
| "commits": [], | ||
| "filesChanged": [], | ||
| "projectId": "/Users/khaliqgant/Projects/AgentWorkforce/relay", | ||
| "tags": [], | ||
| "_trace": { | ||
| "startRef": "f5dd259e2a7009bcdbc1e9aa30c750ac74e5aeca", | ||
| "endRef": "f5dd259e2a7009bcdbc1e9aa30c750ac74e5aeca" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.