Skip to content

fix(nats): robust stream init + downstream dependency - #648

Merged
POWERFULMOVES merged 2 commits into
PMOVES.AI-Edition-Hardenedfrom
fix/nats-init-silent-failure
Feb 17, 2026
Merged

fix(nats): robust stream init + downstream dependency#648
POWERFULMOVES merged 2 commits into
PMOVES.AI-Edition-Hardenedfrom
fix/nats-init-silent-failure

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

Summary

  • init_streams.sh: Rewrite add_stream() to capture nats CLI output, grep for "already in use"/"already exists" to classify exit codes. Real failures (auth, JetStream disabled, disk full) now print stderr and cause non-zero exit.
  • docker-compose: Add nats-init: service_completed_successfully dependency to agent-zero, botz-gateway, and a2ui-nats-bridge so they wait for stream creation before starting.

Fixes silent failure audit issues #1 (CRITICAL) and #5 (HIGH).

Test plan

  • docker compose up nats nats-init — verify streams created, exit 0
  • Stop NATS, run nats-init alone — verify non-zero exit with error message
  • docker compose up --profile agents — verify agent-zero waits for nats-init

🤖 Generated with Claude Code

hunnibear and others added 2 commits February 17, 2026 17:06
…ms.sh

The add_stream() helper used `|| echo "already exists"` which defeated
`set -e` and masked all errors (auth failures, JetStream disabled, disk
full, etc.) as benign "already exists" messages.

Now: captures nats CLI output, greps for "already in use"/"already exists"
to classify the exit code. Real failures print stderr output, increment
FAIL_COUNT, and cause a non-zero exit at script end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Services that rely on JetStream streams (agent-zero, botz-gateway,
a2ui-nats-bridge) now depend on nats-init with
service_completed_successfully. This ensures streams exist before
consumers start, preventing runtime failures when publishing to
geometry.>, tokenism.>, or botz.> subjects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/nats-init-silent-failure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@POWERFULMOVES
POWERFULMOVES merged commit 57fb9f1 into PMOVES.AI-Edition-Hardened Feb 17, 2026
6 of 17 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the fix/nats-init-silent-failure branch March 7, 2026 21:47
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