Skip to content

fix(cyberstrike): 58 Correcting error preventing using of EC2 instance role via co… - #59

Merged
badchars merged 1 commit into
CyberStrikeus:mainfrom
csmcguire:fix-58-correcting-using-ec2-instance-role
Aug 11, 2026
Merged

fix(cyberstrike): 58 Correcting error preventing using of EC2 instance role via co…#59
badchars merged 1 commit into
CyberStrikeus:mainfrom
csmcguire:fix-58-correcting-using-ec2-instance-role

Conversation

@csmcguire

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes: Issue 58
Updated line 248 in packages/cyberstrike/src/provider/provider.ts to include a check if a providerConfig was supplied. This previously caused an early exit if all items in the if statement were blank.

The second change started at line 258 resolved an issue where Bun would crash when parsing local file structures, with error 'parseKnownFiles' is a Symbol.

Type of change

  • Bug fix
  • New feature / agent
  • Security tool / MCP server / Bolt plugin
  • Agent skill / knowledge base
  • UI / TUI improvement
  • Documentation
  • Refactor / performance
  • CI / infrastructure

Security impact

  • This PR adds or modifies tool execution (shell, file, network)
  • This PR changes agent permissions or scope
  • This PR modifies authentication / authorization logic
  • This PR has no security impact

How did you verify it works?

Tested on EC2 that the config file is read and Cyberstrike can send prompts to Amazon Bedrock without API error using the attached EC2 Instance role.

Checklist

  • bun turbo typecheck passes
  • Tested locally with at least one LLM provider
  • PR is focused on a single change
  • No secrets, credentials, or API keys in the diff
  • Breaking changes are documented (if any)
image

@github-actions

Copy link
Copy Markdown
Contributor

Hey! Your PR title Fix: 58 Correcting error preventing using of EC2 instance role via co… doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, cyberstrike).

See CONTRIBUTING.md for details.

@csmcguire csmcguire changed the title Fix: 58 Correcting error preventing using of EC2 instance role via co… fix(cyberstrike): 58 Correcting error preventing using of EC2 instance role via co… Jul 25, 2026

@badchars badchars left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR and for testing this on a real EC2 instance — the guard fix on line 248 (!providerConfig) is exactly right and matches what upstream is doing in anomalyco/opencode#40522.

One concern with the credential provider change: replacing fromNodeProviderChain() with fromInstanceMetadata() fixes the EC2 Instance Role case, but breaks other credential sources that the chain previously covered — SSO profiles, ~/.aws/credentials, credential_process, Web Identity tokens, etc. These are all valid ways to authenticate to Bedrock.

I understand the Bun parseKnownFiles Symbol crash motivated this change. We'll merge the PR as-is (guard fix is the critical part and it works for EC2), then follow up with a commit that restores fromNodeProviderChain with a fallback to fromInstanceMetadata so all credential sources work.

Thanks again for the contribution!

@badchars
badchars merged commit acde6ca into CyberStrikeus:main Aug 11, 2026
3 of 4 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] Unable to use the attached EC2 Instance Role to authenticate to Amazon-Bedrock

2 participants