Skip to content

Ensure program selection always opens target program#217

Merged
mad-sol-dev merged 2 commits into
mainfrom
codex/update-autoopen-behavior-for-program-invocation
Nov 25, 2025
Merged

Ensure program selection always opens target program#217
mad-sol-dev merged 2 commits into
mainfrom
codex/update-autoopen-behavior-for-program-invocation

Conversation

@mad-sol-dev
Copy link
Copy Markdown
Owner

Summary

  • always request program opens during selection and treat failures as errors
  • verify active program status after open and include mismatch warnings
  • update selection tests for new auto-open behavior and error propagation

Testing

  • pytest bridge/tests/unit/test_program_selection_tools.py

Codex Task

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.

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

Comment thread bridge/api/tools.py
Comment on lines +426 to +430
autoopen_warnings, autoopen_error = _maybe_autoopen_program(
client, files, state.domain_file_id
)
if autoopen_error:
return autoopen_error
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Auto-open errors leave selection locked

The select flow locks the requester to the chosen program before calling _maybe_autoopen_program, and when that helper returns an error these lines exit immediately. Because the state was already marked locked, a transient open_program failure now leaves the session locked to a program that was never opened; with the default strict switch policy, subsequent selection attempts for other programs will raise ProgramSelectionError, forcing a session restart to recover. Consider delaying the lock or rolling back the selection when auto-open fails so errors don’t strand the requester.

Useful? React with 👍 / 👎.

@mad-sol-dev mad-sol-dev merged commit 0b9c9e7 into main Nov 25, 2025
5 checks passed
@mad-sol-dev mad-sol-dev deleted the codex/update-autoopen-behavior-for-program-invocation branch November 25, 2025 19:02
mad-sol-dev added a commit that referenced this pull request Jan 9, 2026
…vior-for-program-invocation

Ensure program selection always opens target program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant