Skip to content

Commit fe86528

Browse files
authored
Merge branch 'main' into fix/exec-abort-listener-cleanup
2 parents 123885f + 70230f4 commit fe86528

8,784 files changed

Lines changed: 789567 additions & 226139 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
name: agent-transcript
3+
description: "Add a redacted agent transcript section to GitHub PR or issue bodies during OpenClaw agent-created PR/issue workflows."
4+
---
5+
6+
# Agent Transcript
7+
8+
Best-effort local-only provenance for OpenClaw PR/issue bodies. Use during agent-created GitHub PR or issue workflows before creating/updating the body.
9+
10+
## Contract
11+
12+
- Never use network. Session discovery reads local agent logs only.
13+
- Never upload raw logs. Render sanitized Markdown first.
14+
- Always ask the user before adding transcript logs to a GitHub PR/issue body.
15+
- Tell the user sanitized session logs help reviewers and can make PRs easier to prioritize.
16+
- Offer a local HTML preview before insertion. If the user wants preview, open it and wait for confirmation before adding the section.
17+
- Fail closed on unresolved secrets, private keys, browser/session/cookie details, or auth URLs.
18+
- Drop system/developer prompts, raw tool outputs, reasoning, env, cookies, tokens, and broad local paths.
19+
- Keep user prompts, assistant visible decisions, terse tool summaries, and test/proof outcomes.
20+
- Remove session turns unrelated to the PR/issue work. Use the PR/issue title, branch name, changed files, and stated goal as scope; omit earlier/later unrelated tasks even when they are in the same session log.
21+
- Best effort only: PR/issue creation must continue if no safe transcript is found.
22+
- Add the `## Agent Transcript` section only when inserting a real transcript. Never add a placeholder transcript heading or text such as "A sanitized local transcript preview was generated but not included."
23+
- Use a collapsed `<details>` section and update existing markers instead of duplicating sections.
24+
25+
## Helper
26+
27+
```bash
28+
.agents/skills/agent-transcript/scripts/agent-transcript --help
29+
```
30+
31+
Find a likely local session:
32+
33+
```bash
34+
.agents/skills/agent-transcript/scripts/agent-transcript find \
35+
--query "$PR_TITLE $BRANCH_OR_PR_URL" \
36+
--cwd "$PWD" \
37+
--since-days 14
38+
```
39+
40+
`find` scans the newest 400 matching local JSONL logs by default across Codex, Claude, Pi, and OpenClaw agent sessions. Use `--max-files N` for a wider local search.
41+
42+
Render a PR/issue body section:
43+
44+
```bash
45+
.agents/skills/agent-transcript/scripts/agent-transcript render \
46+
--session "$SESSION_JSONL" \
47+
--out /tmp/agent-transcript.md
48+
```
49+
50+
Preview one candidate session locally:
51+
52+
```bash
53+
.agents/skills/agent-transcript/scripts/agent-transcript preview \
54+
--session "$SESSION_JSONL" \
55+
--out /tmp/agent-transcript-preview.html
56+
open /tmp/agent-transcript-preview.html
57+
```
58+
59+
Append/update a body file before `gh pr create --body-file` or connector PR creation:
60+
61+
```bash
62+
.agents/skills/agent-transcript/scripts/agent-transcript append-body \
63+
--body /tmp/pr-body.md \
64+
--session "$SESSION_JSONL" \
65+
--out /tmp/pr-body.with-transcript.md
66+
```
67+
68+
## PR/Issue Workflow
69+
70+
1. Draft the normal PR/issue body first.
71+
2. Run `find` with title, branch, PR URL/number if known, and cwd.
72+
3. If a high-confidence session is found, ask:
73+
`Include a redacted agent transcript? It helps reviewers and can make the PR easier to prioritize. I can open a local preview first.`
74+
4. If the user wants preview, run `preview`, open the HTML with `open`, and wait for confirmation.
75+
5. Before insertion, trim unrelated session turns from the generated section. Keep only turns that explain this PR/issue's goal, implementation choices, files, tests, proof, blockers, and final outcome.
76+
6. If the user approves, run `append-body`.
77+
7. Use the enriched body file for creation/update.
78+
8. If no safe session is found, say nothing and continue without transcript. If the user declines, continue without transcript and do not add any transcript placeholder section.
79+
80+
## Review Artifacts
81+
82+
For manual audits across many PR/session candidates, create a local HTML preview from a local JSON file. This is for maintainers only and is not part of the PR/issue workflow:
83+
84+
```bash
85+
.agents/skills/agent-transcript/scripts/agent-transcript html \
86+
--prs /tmp/recent-prs.json \
87+
--out /tmp/agent-transcript-preview.html
88+
```

0 commit comments

Comments
 (0)