Skip to content

fix: guard Copilot-style login for non-Copilot agents; pre-parse PSI before navigation - #1194

Merged
catatafishen merged 2 commits into
masterfrom
fix/opencode-signin-guard
Oct 20, 2026
Merged

catatafishen merged 2 commits into
masterfrom
fix/opencode-signin-guard

Conversation

@agentbridge-fixer

Copy link
Copy Markdown

Two independent fixes:

  1. Sign-in guard (refs OpenCode sign in fails, wrong command used #1193): AuthLoginService built <binary> login, which is only valid for Copilot. For OpenCode it fails with a chdir ... -> 'login' error. startInlineAuth()/startCopilotLogin() are now gated on the active profile's supportsOAuthSignIn; other profiles use their terminalSignInCommand or show a 'sign in via the CLI' message. Root cause of how the user reached this path is still being investigated (questions posted on the issue), so this does not close it.
  2. Pre-parse PSI before navigation: parse the file's PSI in a read action off the EDT before opening it, avoiding the 'File should be parsed when changing editor state' error and possible UI freezes (e.g. Markdown with preview).

Restoring editor state for a freshly opened file (e.g. Markdown with preview)
logs "File should be parsed when changing editor state" and can freeze the UI
when the PSI is still unparsed on the EDT. Parse it in a read action on the
calling background thread first.
AuthLoginService.resolveAuthCommand() builds '<binary> login', which is only
valid for Copilot. For other agents (e.g. OpenCode, which treats the argument
as a project directory) it fails with a confusing chdir error.

Guard startInlineAuth() and startCopilotLogin() on the active profile's
supportsOAuthSignIn flag. Other profiles use their terminalSignInCommand if
defined, otherwise show a message to sign in via the CLI and retry.

Refs #1193 (defensive part; root cause still being investigated)
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...atafishen/agentbridge/psi/tools/file/FileTool.java 0.00% 15 Missing ⚠️

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

IDE Compatibility Matrix

✅ pass ❌ fail 🚫 unavailable ❓ no test yet

Generated from the real-IDE integration bench (:ide-integration-tests).

Tool CL IU RD
PSI / Navigation      
search_symbols ✅ ✅ 🚫
get_file_outline ✅ ✅ ❓
find_references ✅ ✅ ❓
go_to_declaration ✅ ✅ ❓
get_documentation ✅ ✅ ❓
get_symbol_info ✅ ✅ ❓
get_class_outline ❓ ❓ ❓
Code Quality      
get_highlights ✅ ✅ ✅
get_problems ✅ ✅ ✅
get_compilation_errors ✅ ✅ ✅
get_available_actions ❓ ❓ ❓
apply_action ❓ ❓ ❓
apply_quickfix ❓ ❓ ❓
format_code ❓ ❓ ❓
optimize_imports ❓ ❓ ❓
suppress_inspection ❓ ❓ ❓
Refactoring      
get_type_hierarchy 🚫 ✅ ❓
get_call_hierarchy 🚫 ✅ ❓
find_implementations 🚫 ✅ ❓
find_super_methods ❓ ❓ ❓
refactor ❓ ❓ ❓
convert_java_to_kotlin ❓ ❓ ❓
Testing      
run_tests ❓ ❓ ❓
list_tests ❓ ❓ ❓
run_configuration ❓ ❓ ❓
get_coverage ❓ ❓ ❓
Debug      
debug_session_start ❓ ❓ ❓
breakpoint_manage ❓ ❓ ❓
debug_evaluate ❓ ❓ ❓
debug_snapshot ❓ ❓ ❓
debug_inspect_frame ❓ ❓ ❓
debug_variable_detail ❓ ❓ ❓
debug_read_console ❓ ❓ ❓
debug_step ❓ ❓ ❓
debug_run_to_line ❓ ❓ ❓
Build      
read_build_output ❓ ❓ ❓
reload_project_model ❓ ❓ ❓

Logged IDE errors (non-gating)

Scraped from the IDE log during the run. These do not fail a matrix cell (the cell reflects the tool's MCP response) — they are listed for visibility while the bench matures.

⚠️ CL — (java.lang.IllegalStateException: There is no ProgressIndicator or Job in this thread, the current job is not cancellable.)
Test: com.github.catatafishen.agentbridge.integration.GetHighlightsIntegrationTest.get_highlights returns a non-error response ⏎ You can find logs and other useful info in CI artifacts under the path getHighlights ⏎ java.lang.IllegalStateException: There is no ProgressIndicator or Job in this thread, the current job is not cancellable. ⏎ at com.intellij.openapi.progress.CoroutinesKt.runBlockingCancellable$lambda$0(coroutines.kt:153) ⏎ at com.intellij.openapi.progress.ContextKt.prepareThreadContext$lambda$0(context.kt:93) ⏎ at com.intellij.concurrency.ThreadContext.resetThreadContext(threadContext.kt:294) ⏎ at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:92) ⏎ at com.intellij.openapi.progress.CoroutinesKt.runBlockingCancellable(coroutines.kt:151)
⚠️ CL — (java.lang.InterruptedException: null)
Test: com.github.catatafishen.agentbridge.integration.GetHighlightsIntegrationTest.get_highlights returns a non-error response ⏎ You can find logs and other useful info in CI artifacts under the path getHighlights ⏎ java.lang.InterruptedException ⏎ at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:124) ⏎ at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$BuildersKt__BuildersKt(Builders.kt:87) ⏎ at kotlinx.coroutines.BuildersKt__BuildersKt.runBlockingWithParallelismCompensation(Builders.kt:63) ⏎ at kotlinx.coroutines.BuildersKt.runBlockingWithParallelismCompensation(Unknown Source) ⏎ at kotlinx.coroutines.internal.intellij.IntellijCoroutines.runBlockingWithParallelismCompensation(intellij.kt:48)

@catatafishen
catatafishen merged commit 5207fcd into master Oct 20, 2026
25 of 28 checks passed
@catatafishen
catatafishen deleted the fix/opencode-signin-guard branch October 20, 2026 20:15

This branch was successfully deployed

1 active deployment
fuzzing — 539a4591 Deployed Oct 20, 2026 by agentbridge-fixer[bot] via ClusterFuzzLite PR (address) #1643
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.

2 participants