Skip to content

Commit 66f92ad

Browse files
committed
feat(flow): harden codex workflow routing and review ops
Codex workflows in Flow had grown useful but still had weak edges around crash recovery, review handoff, and prompt inspection. This change makes the wrapper path more deterministic and cheaper to reopen: Codex sessions can now be listed quickly from the state DB after a restart, optional thread metadata is read schema-safely, and explicit workflow routes for review/commit/sync/session references stay compact instead of relying on raw chat inference. It also turns PR feedback and skill work into inspectable runtime surfaces. Flow now emits richer review artifacts, exposes resolve and skill sync/reload APIs for the daemon and myflow, logs daily Codex/daemon activity, and dedupes sync output more robustly. The intent is better robustness first: recover state cleanly after crashes, avoid duplicated or stale context, and make the exact routing/context decisions visible before Codex starts.
1 parent 9f0c4e7 commit 66f92ad

16 files changed

Lines changed: 4892 additions & 207 deletions

docs/commands/ai.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ f ai
1515
# Provider-specific list/read
1616
f ai claude list
1717
f ai codex list
18+
f ai codex sessions
19+
f ai codex sessions --path ~/repos/mark3labs/kit
1820
f ai cursor list
1921
f codex resolve "latest"
2022
f codex resolve "https://linear.app/.../project/.../overview" --json
@@ -97,6 +99,30 @@ Behavior:
9799
This keeps prompt cost flat unless Flow has a strong reason to recover or unroll context.
98100
Use `f codex doctor` to confirm whether wrapper transport, runtime skills, and context budgets are actually active for the current repo.
99101

102+
### Codex sessions after a crash or restart
103+
104+
If your Mac restarts and you lose the live Codex terminals, use:
105+
106+
```bash
107+
f ai codex sessions
108+
f ai codex sessions --path ~/repos/mark3labs/kit
109+
```
110+
111+
Behavior:
112+
113+
- lists recent Codex sessions for the current path
114+
- sorts by the last message timestamp descending
115+
- shows the stable session id plus a preview of the latest message
116+
- the numeric index matches `continue`, so you can reopen quickly
117+
118+
Examples:
119+
120+
```bash
121+
f ai codex continue 1 --path ~/repos/mark3labs/kit
122+
f ai codex continue 019cd046 --path ~/repos/mark3labs/kit
123+
f ai codex sessions --path ~/repos/mark3labs/kit --json
124+
```
125+
100126
### Optional `flow.toml` resolver config
101127

102128
You can teach `f codex open` and `f codex resolve` to unroll repo-specific references:

docs/commands/pr.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ f pr feedback
2020
# Pull feedback for specific PR and store as local todos
2121
f pr feedback 8 --todo
2222
f pr feedback https://github.com/owner/repo/pull/8 --todo
23+
24+
# Full inline diff/review context is now the default
25+
f pr feedback 8
26+
27+
# Use terse terminal output if needed
28+
f pr feedback 8 --compact
2329
```
2430

2531
## Feedback Workflow
@@ -32,12 +38,27 @@ f pr feedback https://github.com/owner/repo/pull/8 --todo
3238

3339
It then:
3440

35-
1. Prints a concise actionable list in terminal.
36-
2. Writes a snapshot to `.ai/reviews/pr-feedback-<pr>.md`.
37-
3. Optionally (`--todo`) records feedback into `.ai/todos/todos.json` with dedupe via external refs.
41+
1. Prints an actionable list in terminal with inline review state and diff hunk context by default.
42+
2. Writes a markdown snapshot to `.ai/reviews/pr-feedback-<pr>.md`.
43+
3. Writes a machine-readable JSON snapshot to `.ai/reviews/pr-feedback-<pr>.json`.
44+
4. Writes a human review plan to `~/plan/review/<repo>-pr-<pr>-feedback.md`.
45+
5. Writes a PR-local execution artifact to `~/plan/review/<repo>-pr-<pr>-review-rules.md`.
46+
6. Writes a Kit system prompt to `~/plan/review/<repo>-pr-<pr>-kit-system.md`.
47+
7. Optionally (`--todo`) records feedback into `.ai/todos/todos.json` with dedupe via external refs.
48+
49+
The review plan includes ready-to-run `kit` commands for:
50+
51+
- deterministic repo review via `kit review`
52+
- preventative lint/review rule synthesis from the fetched GitHub feedback set
53+
54+
The generated `*-review-rules.md` artifact contains the per-item resolution loop,
55+
prompt template, required response sections, and Kit-upgrade decision order so
56+
the workflow can be reopened without extra instructions.
3857

3958
## Notes
4059

4160
- If no selector is passed, Flow resolves the PR from the current branch.
4261
- `f pr feedback --todo` is safe to re-run; existing feedback refs are not duplicated.
62+
- `f pr feedback` is full-context by default. Use `--compact` if you want the older terse terminal view.
63+
- `f pr feedback` now emits a Kit-ready handoff, so the same feedback set can drive a future review bot instead of staying trapped in GitHub comments.
4364
- `f pr open edit` remains the quickest path to tweak PR title/body from local editor.

0 commit comments

Comments
 (0)