Skip to content

fix(cosh): restore bash option after canceling from provider screen#393

Merged
samchu-zsl merged 1 commit intoalibaba:mainfrom
kongche-jbw:fix/cosh/restore-bash-option-on-cancel
Apr 28, 2026
Merged

fix(cosh): restore bash option after canceling from provider screen#393
samchu-zsl merged 1 commit intoalibaba:mainfrom
kongche-jbw:fix/cosh/restore-bash-option-on-cancel

Conversation

@kongche-jbw
Copy link
Copy Markdown
Collaborator

Description

When a user enters the Custom Provider screen without making changes and
presses Escape to go back, the "Continue to Bash" option disappears from
the authorization dialog. The root cause is that cancelAuthentication
unconditionally sets showBashOptionInAuthDialog to false. The fix
restores it to its initial value (showBashOptionOnStartup) so the bash
option reappears after cancellation. The same fix is applied to
openAuthDialog.

Related Issue

fixes #385

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional change)
  • Performance improvement
  • CI/CD or build changes

Scope

  • cosh (copilot-shell)
  • sec-core (agent-sec-core)
  • skill (os-skills)
  • sight (agentsight)
  • tokenless (tokenless)
  • Multiple / Project-wide

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly
  • For cosh: Lint passes, type check passes, and tests pass
  • For sec-core (Rust): cargo clippy -- -D warnings and cargo fmt --check pass
  • For sec-core (Python): Ruff format and pytest pass
  • For skill: Skill directory structure is valid and shell scripts pass syntax check
  • For sight: cargo clippy -- -D warnings and cargo fmt --check pass
  • For tokenless: cargo clippy -- -D warnings and cargo fmt --check pass
  • Lock files are up to date (package-lock.json / Cargo.lock)

Testing

  1. Start cosh without auth configured — verify "Continue to Bash" visible
  2. Select "Custom Provider", press Escape without entering credentials
  3. Verify "Continue to Bash" option is still visible
  4. make format — passes
  5. npm run lint:ci — passes
  6. make test — 396 files, 7278 tests all pass

Additional Notes

Changes: useAuth.ts (fix) + useAuth.test.ts (new tests)

    - Restore showBashOptionInAuthDialog to startup value
      in cancelAuthentication and openAuthDialog
    - Add tests for both startup=true and startup=false cases
@kongche-jbw kongche-jbw self-assigned this Apr 27, 2026
@kongche-jbw kongche-jbw requested a review from samchu-zsl as a code owner April 27, 2026 16:39
@gemini-code-assist
Copy link
Copy Markdown

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@github-actions github-actions Bot added the component:cosh src/copilot-shell/ label Apr 27, 2026
Copy link
Copy Markdown
Collaborator

@samchu-zsl samchu-zsl left a comment

Choose a reason for hiding this comment

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

LGTM, thx!

@samchu-zsl samchu-zsl merged commit b6a8e81 into alibaba:main Apr 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:cosh src/copilot-shell/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cosh] bug: 进入Custom Provider界面,不做任何配置,再回到authorization界面时,进入bash的选项消失

2 participants