Skip to content

feat(omp): support integration args and options in build_exec_args - #4876

Open
kevinnguyenhoang91 wants to merge 11 commits into
github:mainfrom
kevinnguyenhoang91:kevinnguyenhoang91/feat/enable_integration_args_options_omp
Open

kevinnguyenhoang91 wants to merge 11 commits into
github:mainfrom
kevinnguyenhoang91:kevinnguyenhoang91/feat/enable_integration_args_options_omp

Conversation

@kevinnguyenhoang91

@kevinnguyenhoang91 kevinnguyenhoang91 commented Oct 8, 2026 •

Copy link
Copy Markdown
  • Pass per-step integration_args straight through to the omp CLI.
  • Map the named options profile, thinking, and tools to their flags.
  • Add validate_runtime_config to reject unknown options, empty values, and invalid thinking levels before the command runs.
  • Reject integration_options.model so model selection stays on the command-step 'model' field.

Description

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest (9843 passed; 11 failures, all in the *_python_parity shell-script tests, which this PR does not touch)
  • Tested with a sample project (if applicable): specify init sample --integration omp generates .omp/commands/*

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (fill in the disclosure below)

AI disclosure: Claude Code (model: Claude Sonnet 5.5, autonomous) handled review feedback: it added the -- option-terminator rejection and its tests (6234eee), ran the checks above, and updated this description. Authorship of the earlier commits is not covered by this note; the contributor should add it.

🤖 Generated with Claude Code

- Pass per-step integration_args straight through to the omp CLI.
- Map the named options profile, thinking, and tools to their flags.
- Add validate_runtime_config to reject unknown options, empty values,
  and invalid thinking levels before the command runs.
- Reject integration_options.model so model selection stays on the
  command-step 'model' field.
Copilot AI balanced review requested due to automatic review settings October 8, 2026 08:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new deterministic argument-building and validation behavior lacks required positive and negative tests.

1 open finding
What changed in this PR

Adds OMP runtime argument and option support with upfront validation.

Changes:

  • Passes per-step arguments to OMP.
  • Maps profile, thinking, and tools options to CLI flags.
  • Validates runtime configuration values.
File Description
src/​specify_cli/​integrations/​omp/​__init__.py Builds and validates OMP runtime arguments.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

- Verify integration_args and integration_options are passed to omp
  and ordered after SPECKIT_INTEGRATION_OMP_EXTRA_ARGS.
- Accept every documented thinking level and valid runtime configs.
- Reject malformed args, the reserved model option, and invalid,
  unknown or non-string option keys and values.
Copilot AI balanced review requested due to automatic review settings October 8, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Raw arguments bypass model-field enforcement, and the new public options remain undocumented.

0 open findings

1 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity Reject model flags in per-step integration_args

src/​specify_cli/​integrations/​omp/​__init__.py:57

integration_args can still select a model (for example, ['--model', 'gpt-5']), so a step can run a model while its top-level model field—and recorded output—remain unset. This defeats the stated invariant enforced for integration_options.model; reject OMP's model flag forms in per-step raw args as well, with a regression test.

Low severity Document OMP runtime options in the integrations reference

src/​specify_cli/​integrations/​omp/​__init__.py:33

These new public runtime options are not documented in the supported-integrations reference, and the workflow reference still describes only Docker Agent's named options. design/integration.md:65-66 requires agent-specific options to be represented in docs/reference/integrations.md; document OMP's profile, thinking, and tools options (including accepted thinking values and argument precedence) so workflow authors can discover and use this API.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@kevinnguyenhoang91

Copy link
Copy Markdown
Author

Fixing:

Will be in the next commit.

Model selection must go through the command-step `model` field, so a
`--model` flag in `integration_args` now fails validation before OMP is
launched. This matches the existing rejection of `integration_options.model`
and avoids two competing model sources on the command line.

- Reject `--model` and `--model=...` in `integration_args`; `--models`
  (Ctrl+P cycling scope) stays allowed.
- Document `profile`, `thinking`, and `tools` options, `integration_args`
  passthrough, and argument ordering in the integrations reference.
- Link the OMP options from the workflows per-step configuration section.
- Add tests for rejected `--model` forms and the allowed `--models` flag.
Copilot AI balanced review requested due to automatic review settings October 8, 2026 08:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation matches the documented behavior and includes appropriate positive and negative coverage.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

An accepted -- argument prevents generated options and the intended prompt from being parsed correctly.

1 open finding

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@mnriem

mnriem commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

A bare '--' passed validation and, being inserted before the generated
--model, --mode json and prompt, made OMP treat them as positional
messages. Reject it in validate_runtime_config and add regression tests.

Assisted-by: Claude Code (model: Claude Sonnet 5.5, autonomous)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 12:50
@kevinnguyenhoang91

Copy link
Copy Markdown
Author

Review round summary (fix commit 6234eee):

  • Missing tests for integration_args/options (thread r4216493726): already addressed in da070fe. Positive argv and negative cases (model, unknown/empty values, malformed args, invalid thinking) are covered. The thread was already resolved, so no change this round.
  • Reject -- in integration_args (thread r4218591436): fixed in 6234eee, with regression tests.
  • Earlier Copilot notes (reject --model in per-step args; document OMP options) were handled in 1362568.

AI-generated reply posted on behalf of @kevinnguyenhoang91 by Claude Code (model: Claude Sonnet 5.5, autonomous). The agent assessed the review comments and wrote the fix and tests; a human has not line-by-line reviewed them.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because OMP’s streaming argument parsing can treat the prompt as a session selector rather than execute it when --resume is supplied.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Upstream moved per-agent docs to docs/integrations/; relocate the OMP
runtime options section to docs/integrations/omp.md and keep both sides
of the workflows.md change.

Assisted-by: Claude Code (model: Claude Sonnet 5.5, autonomous)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the per-step runtime configuration changes.

No open issues 🎉

Review effort: Balanced

OMP normalizes '--=' to the '--' terminator, and bare value-taking flags
(--system-prompt, --resume) consume generated flags or the prompt. Accept
only known valueless flags and self-contained --name=value tokens, and add
regression tests that replay OMP's parsing over the generated argv.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kevinnguyenhoang91

Copy link
Copy Markdown
Author

@mnriem Fixed in 818ce72. I read OMP's args.ts/flag-tables.ts and confirmed all three cases: --= is normalized to -- (end of options), string flags like --system-prompt consume the next token even when flag-looking, and --resume consumes the next non-dash token (the prompt when nothing generated follows).

integration_args now accepts only (a) known valueless flags (e.g. --no-session) and (b) self-contained --name=value tokens. Bare value-taking flags, --= forms, positional text, @file, short flags and --help/--version/--print are rejected before launch. This is stricter than before (bare --verbose / --models a,b no longer pass), because an allowlist can't tell which bare flags take values; docs in docs/integrations/omp.md are updated.

Regression tests replay OMP's parseArgs semantics over the generated argv and assert the prompt, model, thinking and mode survive; they fail without the fix (11 failures) and pass with it. Caveat: omp isn't installed in my environment, so the replay is a Python port of the parser, not the real CLI. One unrelated shell-script parity test (test_check_prerequisites_python_parity) failed in my broader run.

AI-generated reply posted on behalf of @kevinnguyenhoang91 by Claude Code (model: Claude Sonnet 5.5, autonomous). The agent made the change and tests; a human has not line-by-line reviewed them.

Copilot AI auto review requested due to automatic review settings November 3, 2026 02:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because inline reserved flags can bypass validation and cause a workflow to report success without executing the prompt.

No open issues 🎉

Review effort: Balanced (auto)

Copilot AI auto review requested due to automatic review settings November 3, 2026 02:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Equals-form --help and --version arguments bypass validation, causing OMP to display information and exit instead of executing the workflow prompt.

1 open issue

Review effort: Balanced (auto)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI auto review requested due to automatic review settings November 3, 2026 12:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed to evaluate critical workflow-prompt bypasses and unexpected early exits caused by accepted equals-form flags.

No open issues 🎉

1 resolved since last review

Review effort: Balanced (auto)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical OMP argument-handling gaps let accepted flags bypass workflow execution, write unintended files, or enter an RPC loop that can wait indefinitely.

2 open issues

Review effort: Balanced (auto)

@mnriem

mnriem commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

…SON is off

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI auto review requested due to automatic review settings November 4, 2026 03:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the per-step Oh My Pi runtime configuration changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced (auto)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Validation accepts --yolo=false and --auto-approve=false, but OMP ignores their values and enables automatic approval, allowing tool execution without expected confirmation.

1 open issue

Review effort: Balanced (auto)

@mnriem

mnriem commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

OMP's parseArgs splits `--name=value` at `=`, matches only the flag
name for booleans, and drops the inline value, so `--yolo=false` and
`--auto-approve=false` still enable automatic approval. Reject the
equals-form of every known valueless flag; bare forms stay allowed.

Constraint: OMP parser (packages/coding-agent/src/cli/args.ts) ignores inline values on boolean flags
Rejected: Block only --yolo/--auto-approve | every boolean flag has the same misleading =false semantics
Confidence: high
Scope-risk: narrow
Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI auto review requested due to automatic review settings November 8, 2026 06:44
@kevinnguyenhoang91

Copy link
Copy Markdown
Author

Review round summary (fix commit b38d29e):

  • --yolo=false / --auto-approve=false enable auto-approval (thread r4471659765): fixed. OMP ignores inline values on boolean flags, so integration_args now rejects the --flag=value form of every known valueless flag. Bare forms are unchanged. New tests: rejection of the false/empty/0 forms and acceptance of the bare approval flags. tests/integrations/test_integration_omp.py and tests/workflows pass (687 tests).

AI-generated summary posted on behalf of @kevinnguyenhoang91 by Claude Code (model: Claude Opus 5.5, autonomous). The agent made the change; a human has not line-by-line reviewed it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the per-step OMP runtime configuration change.

No open issues 🎉

1 resolved since last review

Review effort: Balanced (auto)

This branch has not been deployed

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

Labels

author-awaiting Waiting on author response triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants