Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c286282754
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (cancel === true || approved === false) { | ||
| if (consumedResumeStateKey) { | ||
| await deleteStateJson({ env: ctx.env, key: consumedResumeStateKey }); | ||
| } | ||
| return { status: 'cancelled', output: [] }; |
There was a problem hiding this comment.
Require explicit approval decision before resuming workflow
In the approval-resume branch, only approved === false is treated as cancellation, but approved === undefined is allowed to proceed. Since resumeToolRequest now accepts optional intents, a caller can resume an approval-paused workflow without passing any decision and still execute downstream steps. This bypasses the approval gate for API consumers that call resume programmatically with just a token.
Useful? React with 👍 / 👎.
| if (refValue === undefined) { | ||
| if (pathValue === 'approved' || pathValue === 'skipped') return 'false'; | ||
| return ''; | ||
| } |
There was a problem hiding this comment.
Keep unresolved step refs intact in template substitution
Template expansion now replaces missing $<id>.<path> references with an empty string. The new regex also matches normal shell variable concatenations like $HOME.json, so commands can be silently corrupted when there is no workflow step named HOME. Previously unresolved references were left as-is; this regression can break existing workflow commands by deleting command text unexpectedly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fda74a8189
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (approved !== true) { | ||
| await cleanupIndex(); | ||
| await deleteStateJson({ env: runtime.env, key: payload.stateKey }); | ||
| return okEnvelope('cancelled', [], null, null); |
There was a problem hiding this comment.
Require explicit decision for pipeline approval resumes
The pipeline resume path now treats any value other than approved === true as cancellation, so omitting approved silently cancels and deletes the saved state. Since approved was made optional in this commit to support input resumes, programmatic callers can now accidentally drop an approval-paused pipeline by calling resumeToolRequest without an explicit decision instead of getting a parse error.
Useful? React with 👍 / 👎.
| if (params.previousStateKey) { | ||
| await cleanupApprovalIndexByStateKey({ env: params.env, stateKey: params.previousStateKey }); | ||
| await deleteStateJson({ env: params.env, key: params.previousStateKey }); | ||
| } |
There was a problem hiding this comment.
Preserve prior resume state until new approval ID is persisted
This branch deletes previousStateKey (and its approval index) before creating the next approval ID. If createApprovalIndex fails afterward, the catch removes nextStateKey and rethrows, leaving no resumable state at all. That turns a transient storage/index failure into unrecoverable loss of the paused pipeline.
Useful? React with 👍 / 👎.
Summary
needs_input/ structured pause-resume path out of feat: structured input requests, step flow control, and error recovery #39askfor pipeline-level structured input requestsinputsteps pluslobster resume --response-json '{...}'needs_inputScope
Included:
askinputneeds_inputenvelopes--response-jsonresume path$review.response.decisionExplicitly excluded from this PR:
retry/retry_delay/on_errornext/ loops /max_iterationsHardening
Verification
pnpm buildpnpm testRef: #39