Skip to content

feat: structured input requests, step flow control, and error recovery#39

Open
miguelbranco80 wants to merge 13 commits intoopenclaw:mainfrom
miguelbranco80:feat/input-requests
Open

feat: structured input requests, step flow control, and error recovery#39
miguelbranco80 wants to merge 13 commits intoopenclaw:mainfrom
miguelbranco80:feat/input-requests

Conversation

@miguelbranco80
Copy link
Copy Markdown

Implements #38

This PR adds the Lobster-side changes from the design doc:

•⁠ ⁠⁠ input: ⁠ step type with ⁠ needs_input ⁠ pause/resume and schema validation
•⁠ ⁠⁠ $step.response ⁠ / ⁠ $step.subject ⁠ deep field access
•⁠ ⁠Extended ⁠ when ⁠ conditions: comparisons, negation, AND/OR
•⁠ ⁠⁠ next: ⁠ step flow control with ⁠ max_iterations ⁠ loop guard
•⁠ ⁠⁠ retry ⁠, ⁠ retry_delay ⁠, ⁠ on_error ⁠ for step-level error recovery
•⁠ ⁠SDK updated to recognize ⁠ input_request ⁠ halts and ⁠ resume({ response }) ⁠

All changes are additive. Existing workflows, tokens, and conditionals are unchanged.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84da0b2900

ℹ️ 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd0f37e52e

ℹ️ 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ef7170124

ℹ️ 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26e79acd8e

ℹ️ 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 650e4ca515

ℹ️ 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d976c94e8a

ℹ️ 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".

Comment on lines +194 to +195
if (step.input && (!step.input.responseSchema || typeof step.input.responseSchema !== 'object')) {
throw new Error(`Workflow step ${step.id} input.responseSchema must be an object`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow boolean schemas in workflow input steps

true and false are valid JSON Schema documents, but this guard rejects every non-object schema up front. That means a workflow author cannot use permissive/deny-all input.responseSchema values even though the resume-time validator already compiles schemas directly and the rest of the new input machinery handles boolean schemas.

Useful? React with 👍 / 👎.

Comment on lines +130 to +133
haltType: 'input_request',
inputSchema: inputRequest.responseSchema,
prompt: inputRequest.prompt,
createdAt: new Date().toISOString(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate custom input_request schemas before issuing tokens

For registry/custom pipeline commands that halt with type: 'input_request', this path persists the pause and returns needs_input without ever compiling responseSchema. If a plugin emits an Ajv-invalid schema such as {"type":"wat"}, the initial run succeeds but every later resume fails in validatePipelineInputResponse(), leaving callers with an unusable resume token.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant