Refactor shellgenius output flow and default to gpt-5.4-mini#4
Merged
Conversation
10fe08f to
fe2d7c7
Compare
* add a `tests/` scaffold with opt-in live test support * configure `pytest` and `scriv` in `pyproject.toml` * add `CHANGELOG.md` and a Markdown fragment template Co-authored-by: AI <ai@sderev.com>
fb8478f to
50c8d98
Compare
* Add `OpenAIResponsesBackend` and prompt adaptation for the Responses API. * Call `responses.create` for single-response requests without `stop`, and keep `chat.completions.create` as the fallback. * Add mocked tests for non-streaming, streaming, callback, and rate-limit paths. Co-authored-by: AI <ai@sderev.com>
* Parse fenced command output into command, explanation, raw text, and fence language. * Preserve embedded fence lines inside heredoc-style commands and accept blank-line plain-text explanations. * Add parser and CLI regressions for malformed and non-shell fenced output. Co-authored-by: AI <ai@sderev.com>
* add TTY-aware output modes and explicit execution flags * execute generated commands with the parsed shell fence and reject incompatible fences * update CLI tests, README usage, and the changelog fragment for the new behavior Co-authored-by: AI <ai@sderev.com>
* move the project to `openai>=2,<3` and refresh `uv.lock` * default ShellGenius to `gpt-5.4-mini` * add opt-in `real` smoke tests for default and GPT-5.4-family requests * document the default model and live-test opt-in path in `README.md` OpenAI docs describe `gpt-5.4-mini` as the strongest mini model for coding, and `gpt-5-mini` recommends starting with `gpt-5.4 mini` for most new low-latency, high-volume workloads. Co-authored-by: AI <ai@sderev.com>
* update `README.md` to match the current Python requirement, default model, and execution flow * drop a stale inline comment in `shellgenius/gpt_integration.py` Co-authored-by: AI <ai@sderev.com>
50c8d98 to
e3d42ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
openaiSDK and the Responses API, while keeping thenfallback path and rejecting unsupportedstopvalues for GPT-5.4-family models before any API call.pytestandscrivscaffolding, plus mocked and opt-in real smoke tests for the GPT-5.4 family.shellgenius.response_parserinstead of an inline regex.--model,--no-stream,--plain,--command-only,--execute, and--yes, and make--executehonor the parsed shell fence instead of silently switching shells.gpt-5.4-mini, update the README and changelog fragments, and make.ci/gaterun each Python version in an isolated environment.Why
--executeshould not accept one shell fence and run the command in a different shell.gateshould be a reliable multi-version preflight.How to test
gateuv run --group dev pytest -q tests/test_cli.py tests/test_response_parser.pyuv run --group dev pytest -q tests/test_openai_real_smoke.py --run-live -m realuv run shellgenius "list files in the current directory"uv run shellgenius --plain "list files in the current directory"uv run shellgenius --command-only "list files in the current directory"uv run shellgenius --execute "print ok"and answernuv run shellgenius --execute --yes "print ok"uv run shellgenius --execute "list files" </dev/nulland confirm it fails with--yesguidance instead of hangingRisk/comp notes
--execute.--executenow follows the parsed fence language and rejects incompatible shell fences on the current platform.gpt-5.4-mini, so users need access to that model or must override--model.stop, because that parameter is not supported on the current SDK path for those models.Changelog fragment: yes (CLI behavior and default model changed)