这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mg-dev25
Copy link
Contributor

Description

Fixed shell escaping issues when JSON contains special characters by encoding settings JSON as base64 before embedding in bash script.

Related Issue

Fixes #224

Changes

  • Modified claude-auth-helper.js to encode JSON settings as base64 before passing to shell
  • This prevents bash parsing errors when JSON contains quotes and other special characters
  • Resolves the "unexpected EOF while looking for matching quote" error on ARM Ubuntu servers

Checklist

  • I tested my changes
  • I reviewed my own code

@vercel
Copy link

vercel bot commented Sep 24, 2025

@mg-dev25 is attempting to deploy a commit to the Superagent Team on Vercel.

A member of the Team first needs to authorize it.

@mg-dev25 mg-dev25 marked this pull request as ready for review September 24, 2025 20:42
@mg-dev25 mg-dev25 force-pushed the fix-shell-escaping-issue-224 branch from df51ffb to b7da616 Compare September 25, 2025 08:02
@mg-dev25 mg-dev25 marked this pull request as draft September 25, 2025 09:36
@homanp
Copy link
Collaborator

homanp commented Sep 25, 2025

@mg-dev25 ping when you want me to review. Please split into 2 separate prs if possible

@mg-dev25 mg-dev25 force-pushed the fix-shell-escaping-issue-224 branch from b7da616 to b98e6f5 Compare September 26, 2025 20:28
…tent

Encode settings JSON as base64 before embedding in bash script to prevent
shell escaping issues when JSON contains special characters
…tent

Encode settings JSON as base64 before embedding in bash script to prevent
shell escaping issues when JSON contains special characters like quotes.

Also update Claude settings path to use os.homedir() for better cross-platform
compatibility instead of hardcoded /root/.claude.json path.

Fixes superagent-ai#224: Resolves 'bash: -c: line 2: unexpected EOF while looking for
matching quote' error on ARM Ubuntu servers when JSON settings contain
special characters that break shell parsing.
@mg-dev25 mg-dev25 force-pushed the fix-shell-escaping-issue-224 branch from b98e6f5 to 2ba50d5 Compare September 26, 2025 20:39
@homanp
Copy link
Collaborator

homanp commented Sep 30, 2025

@mg-dev25 is this ready?

@mg-dev25 mg-dev25 marked this pull request as ready for review September 30, 2025 13:50
@mg-dev25
Copy link
Contributor Author

@homanp This PR is ready and test, but I will push other issue I found not relate to this one that make Claude code not operate completely or crash.

Copy link
Collaborator

@homanp homanp left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution!

@homanp homanp merged commit 63730e6 into superagent-ai:main Oct 1, 2025
2 of 5 checks passed
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.

[Bug]: bash: -c: line 2: unexpected EOF while looking for matching `"'

2 participants