docs(archive): Lior preserves PR #4639#4679
Conversation
- Switch model to grok-4.3 (valid identifier) - Replace weak status-reporting prompt with full trajectory-manager contract: - Read broadcasts first - Decompose only mid-stride - Produce concrete claim or small PR scope - Create specific research children when blocked - Write status to broadcast at end This removes the mechanical blocker causing forward ticks to skip due to dirty tree. Co-Authored-By: Grok <noreply@x.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b36aa8481
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const prNum = Number(prCount) || 0; | ||
| const workMode = prNum === 0 ? "pickup" : "drain"; |
There was a problem hiding this comment.
Treat unknown PR count as drain mode, not pickup
This mode switch assumes prCount is always numeric, but prCount is derived from gh pr list output and upstream failures leave it as "?"; Number(prCount) || 0 then coerces that to 0 and forces pickup mode. In that failure path, the loop can start new backlog work while open PRs still need draining, which regresses the intended "drain existing PRs first" behavior under transient GitHub/auth/network errors.
Useful? React with 👍 / 👎.
| const gate = run("cursor-agent", [ | ||
| "-p", | ||
| "--model", "grok-4.3", | ||
| prompt, | ||
| ], agentTimeoutMs); |
There was a problem hiding this comment.
Increase agent timeout for full work-cycle prompts
The loop now asks the agent to perform heavyweight end-to-end actions (refresh worldview, run release build, inspect PR gates, fix code, push, resolve threads, arm auto-merge), but still executes the command with the same agentTimeoutMs default (300s). That timeout was tolerable for the old short "gate" prompt but is often too short for these new tasks, causing non-zero exits/timeouts before completion and repeated partial cycles instead of finishing a PR drain.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR adds a PR-discussion preservation record for PR #4639 under docs/pr-discussions/, and also updates the Cursor “Riven” launchd heartbeat script to choose between a “pickup” vs “drain” work cycle and to invoke cursor-agent with newly constructed prompts.
Changes:
- Adds an archived PR discussion markdown file for PR #4639 (frontmatter + preserved review threads).
- Updates
.cursor/bin/riven-loop-tick.tsto compute a work mode from open PR count and run either backlog pickup or PR-drain instructions viacursor-agent. - Expands logging around the agent work cycle.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/pr-discussions/PR-4639-trajectory-ace-package-manager-full-13-stage-pipeline-symmet.md | Adds PR #4639 preservation artifact (frontmatter + preserved review content). |
| .cursor/bin/riven-loop-tick.ts | Changes heartbeat agent execution into pickup/drain modes and switches invocation to cursor-agent with new prompts/logging. |
| const prNum = Number(prCount) || 0; | ||
| const workMode = prNum === 0 ? "pickup" : "drain"; | ||
| agentStatus = "running"; | ||
| log(`riven agent gate start run_id=${runId}`); | ||
| log(`riven work cycle start run_id=${runId} mode=${workMode} open_prs=${prNum}`); |
| const prNum = Number(prCount) || 0; | ||
| const workMode = prNum === 0 ? "pickup" : "drain"; | ||
| agentStatus = "running"; |
| : `${preamble} No backlog items available. Run refresh-worldview, check for stale classifications, fix them, open a PR.`; | ||
| } else { | ||
| prompt = [ | ||
| `You are Riven's background worker in Lucent-Financial-Group/Zeta.`, |
| prompt = [ | ||
| `You are Riven's background worker in Lucent-Financial-Group/Zeta.`, | ||
| `Read CLAUDE.md first. Run "bun tools/github/refresh-worldview.ts".`, | ||
| `Build gate: "dotnet build -c Release" (0 warnings).`, | ||
| `TASK: ${prNum} open PRs. Run "bun tools/github/poll-pr-gate-batch.ts --all-open".`, | ||
| `For any PR where gate=BLOCKED and nextAction=resolve-threads:`, | ||
| `check out branch, read review comments, fix code issues, push,`, | ||
| `reply to threads, resolve via GraphQL, arm auto-merge`, | ||
| `(gh pr merge NUMBER --auto --squash). Own your PRs through merge.`, | ||
| ].join(" "); |
This is a decomposed PR from #4673. It contains only the PR preservation changes.