r/AI_Coders • • 11d ago

debugging Spring and Kotlin test failures with an AI coding agent with debugger support vs log injection (+how i stopped burning AI Pro credits)

i see that most threads debating the best ai ide or comparing agent plugins focus on greenfield code generation. On our multi-module Spring Boot and Kotlin repositories, writing new code takes maybe 15% of the week. The rest goes to chasing broken tests across module boundaries, renaming overloaded methods without breaking downstream callers, and keeping monthly token bills predictable

over the past month we compared two different workflows on the same backlog tickets: running an IDE integrated AI coding agent inside IntelliJ IDEA Ultimate (Junie in the IDE plus Junie CLI connected over `/ide`), versus running standalone editor and terminal loops (Cursor's standalone editor and ACP plugin, alongside f.e. GitHub Copilot)

(i would also share this spreadsheet that i made with a bit of llming but i guess this makes it a bit more readable)

Workflow StepJunie + IntelliJ IDEA (2026.1+)Cursor (Standalone Editor / ACP)GitHub Copilot
Codebase lookupQueries IDE AST symbol index, Find Usages, and type hierarchies on demandQueries repository semantic embeddings index + fast literal text searchWorkspace & GitHub repository semantic index
Multi-file renameInvokes JetBrains IDE refactoring engine + post-edit IDE inspectionsGenerates multi-file agent diffs; verified by test suiteGenerates multi-file agent edits in editor or PR
Debugging failuresAttaches to live paused debugger frame in IDEA Ultimate (breakpoints + expression eval)Injects runtime logging statements, reads repro output, strips logsTerminal test output analysis + chat diagnostics
Cost & model controlAI Pro ($8.33) / Ultimate ($25), zero-markup BYOK, Eco Mode, free Junie Lite (Qwen 3.6 27B)Flat monthly seat tiers with metered high-effort model poolFlat monthly seat tiers + GitHub Actions cloud billing

as for the points, here is where the mechanics separated in daily work

1. paused debugger frames vs runtime log instrumentation

when a JUnit integration test fails three layers deep inside a proxy chain or a Spring `@Configuration` bean returns an unexpected null under a specific profile, reading stack traces rarely shows why the state drifted.

- cursor's Debug Mode takes the log-instrumentation route: it forms hypotheses, injects logging statements into your source files, reads the terminal output while you reproduce the failure, proposes a fix, and strips the logs back out. For async timing bugs that are easier to watch over a full run than to freeze, that workflow is genuinely convenient.

- Junie's Debug Mode (`/debug` or `Shift+Tab` twice in Junie CLI when connected to the IDE) attaches directly to a live debugger session in IntelliJ IDEA Ultimate. Instead of editing source files to add print statements, it sets line or exception breakpoints across project files, library JARs, and decompiled `.class` bytecode, inspects variables across threads in the paused frame, and evaluates expressions like `orderItems.size()` in memory before proposing an edit

2. Compiler-backed AST renames vs generated multi-file diffs

apparently renaming an interface method with 15 call sites and three overloads exposes how each harness sees the project

- standalone editors rely on semantic embeddings and fast text search to locate references, then generate coordinated diffs across all 15 files. Your test suite and PR review have to catch any shadowed variable or missed overload.

- and when connected to a running JetBrains IDE (`2026.1` or newer with the matching project path open, verified via `/ide`), Junie calls IntelliJ's native refactoring engine and `Find Usages` index. References resolve through the compiler's project model, and IDE inspections run over the diff before you commit.

3. fixing jetbrains ai pricing burn with BYOK + Junie Lite

a common complaint around jetbrains ai pricing is how fast the 10 monthly credits on AI Pro ($8.33/mo) or 35 credits on AI Ultimate ($25/mo) disappear if you run frontier models on every small task. We fixed that by splitting tasks across three routes:

- 0-markup BYOK (`/account` -> `Use your own API key` or `--provider` across `anthropic`, `openai`, `google`, `xai`, `openrouter`, `copilot`, and `litellm`): we use `opus` (Claude Opus 5.5) or `gpt-sol` (GPT-6.1 Sol) in read-only `/plan` mode so the agent writes a `.junie/plans` spec first. One quirk to watch on your provider invoice: even on BYOK, Junie routes background context summarization and task classification to a lighter helper model from that same provider (like Claude Haiku or Gemini Flash) to keep latency down.

- Eco Mode / fast model handoff: once the `.junie/plans` markdown spec is approved, implementation and test reruns go to `gpt-luna` or `gemini-flash`.

- Junie Lite as a free AI coding agent baseline: for mechanical work (updating changelogs, writing test scaffolds, fixing lint warnings in a background git worktree), we switch `/model` to Junie Lite. It runs Qwen 3.6 27B on JetBrains infrastructure at zero credit cost (included with free and paid JetBrains accounts, current offer valid through Dec 31, 2026, with no code shared with third-party model providers or used for training).

4. any real limitations and where Cursor or Copilot fit better...?

- first i would say edition and version floor: live in-IDE debugger attachment requires IntelliJ IDEA Ultimate, and the `/ide` CLI bridge returns `Unsupported` if your IDE is older than `2026.1`.

- maybe editor surface? i know Junie has no first-party VS Code or Visual Studio extension (only terminal CLI and ACP). If your team wants to move everyone onto one VS Code-based AI-first editor with integrated Bugbot PR reviews, Cursor is more cohesive. If your org spans VS Code, Visual Studio, Xcode, and JetBrains and relies on assigning GitHub issues to a cloud PR agent, GitHub Copilot covers that breadth better (and runs side-by-side with Junie in IntelliJ without conflict)

now i would ask you folks running agents inside IntelliJ or Rider daily: how are you splitting tasks between paid frontier credits, BYOK keys, and free tiers?

3 Upvotes

5 comments sorted by

1

u/whowasntright 11d ago

i know for sure that splitting PRs by layer helped our team, though UI regressions still slip past unit tests when an ai pair programmer touches shared state. having a containerized smoke run record the browseflow before assigning human reviewers sounds super practical.

1

u/Evening_Hawk_7470 11d ago

so passing unit tests gave us false confidence on frontend state transitions too. Letting /demo spin up the Debian Bookworm container with Chromium and Xvfb catches broken modal or reload flows before anyone wastes twenty minutes reading the diff

1

u/[deleted] 11d ago

[removed] — view removed comment

1

u/whowasntright 11d ago

i would try to learn and get better in putting my experience into words; regardless of that there are some things that i just... think that may be worth sharing even if not ideal in wording