Skip to content

fix: remove --bare flag that breaks auth#198

Merged
kris-hansen merged 1 commit intomainfrom
fix/remove-bare-flag
Mar 28, 2026
Merged

fix: remove --bare flag that breaks auth#198
kris-hansen merged 1 commit intomainfrom
fix/remove-bare-flag

Conversation

@kris-hansen
Copy link
Copy Markdown
Owner

@kris-hansen kris-hansen commented Mar 28, 2026

PR Type:

Bug fix


PR Description:

  • Removed the --bare flag from the command line arguments in the buildArgsAgentic function to fix authentication issues.
  • Updated test cases to reflect the removal of the --bare flag.
  • The --bare flag was causing 'Not logged in' errors by skipping OAuth/credential loading.

PR Main Files Walkthrough:

files:
  • utils/models/claudecode.go: Removed the --bare flag from the args array in the buildArgsAgentic function. This change ensures that OAuth/credential loading is not skipped, thereby fixing the authentication issues.
  • utils/models/claudecode_test.go: Updated multiple test cases in TestClaudeCodeBuildArgsAgentic to remove the --bare flag from the contains array. This aligns the test expectations with the updated behavior of the buildArgsAgentic function.

User Description:

The --bare flag skips OAuth/credential loading, causing 'Not logged in' errors when running Claude Code in -p mode.

Symptoms: claude -p --bare ... returns:

{"result":"Not logged in · Please run /login"}

Root cause: --bare was added based on research suggesting it provides 'deterministic subprocess behavior' but it also skips auth loading.

Fix: Remove --bare, keep other flags (-p, --dangerously-skip-permissions, --allowedTools, --output-format json).

The --bare flag skips OAuth/credential loading, causing 'Not logged in'
errors when running Claude Code in -p mode. Removing it restores normal
auth behavior while keeping the other agentic flags.
@preston-ai
Copy link
Copy Markdown

preston-ai bot commented Mar 28, 2026

PR Analysis

  • 🎯 Main theme: Removal of the --bare flag to fix authentication issues in the buildArgsAgentic function.
  • 📝 PR summary: This PR addresses a bug where the --bare flag was causing authentication issues by skipping OAuth/credential loading. The flag has been removed from the buildArgsAgentic function and corresponding test cases have been updated to reflect this change.
  • 📌 Type of PR: Bug fix
  • 🧪 Relevant tests added: Yes
  • Focused PR: Yes, because the changes are specifically targeted at removing the --bare flag to resolve authentication issues, and the updates are consistently applied across the relevant files.
  • ⏱️ Estimated effort to review [1-5]: 2, because the changes are straightforward, primarily involving the removal of a single flag and updating test cases accordingly.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The PR effectively resolves the authentication issue by removing the problematic --bare flag. Ensure that the removal does not inadvertently affect other functionalities that relied on the deterministic behavior provided by the flag.

How to use

Instructions

To invoke the Preston AI, add a comment using one of the following commands:
/review: Request a review of your Pull Request.
/describe: Update the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
/ask <QUESTION>: Ask a question about the PR.
/add_docs: Generate docstring for new components introduced in the PR.
/generate_labels: Generate labels for the PR based on the PR's contents.

// --bare skips hooks, plugins, MCP server discovery, and OAuth
args := []string{"-p", "--bare"}
// Start with -p for subprocess/one-shot mode and for subprocess mode
// Note: --bare was removed as it breaks auth on some Claude Code versions
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider adding a comment or a log entry to indicate the removal of the --bare flag and its impact on authentication, to help future developers understand the reason behind this change. [medium]

@kris-hansen kris-hansen merged commit 66a2da9 into main Mar 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant