Skip to content

feat: configurable bind hosts for iii-engine and viewer#376

Open
eleboucher wants to merge 1 commit into
rohitg00:mainfrom
eleboucher:feat/host
Open

feat: configurable bind hosts for iii-engine and viewer#376
eleboucher wants to merge 1 commit into
rohitg00:mainfrom
eleboucher:feat/host

Conversation

@eleboucher
Copy link
Copy Markdown

@eleboucher eleboucher commented May 14, 2026

Allow remove deployment by allowing custom bind host

Summary by CodeRabbit

  • New Features

    • Viewer bind host is now configurable via AGENTMEMORY_VIEWER_HOST (default 127.0.0.1). Startup logs show "localhost" for wildcard/loopback binds, otherwise the configured host.
    • iii-engine config path can be overridden via AGENTMEMORY_III_CONFIG with automatic fallback discovery.
  • Documentation

    • README and CLI help updated to document the new environment variables and usage guidance.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

@eleboucher is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

📝 Walkthrough

Walkthrough

Adds two environment variables: AGENTMEMORY_VIEWER_HOST to control viewer bind host (default 127.0.0.1) and AGENTMEMORY_III_CONFIG to override iii-engine config path; updates README and CLI help and implements env-var handling in config discovery and viewer startup.

Changes

Environment Configuration Enhancements

Layer / File(s) Summary
Environment variable documentation
README.md, src/cli.ts
README Configuration and CLI --help Environment section now document AGENTMEMORY_VIEWER_HOST (bind host, default 127.0.0.1) and AGENTMEMORY_III_CONFIG (iii-engine config override, supports full path or bundled filename such as iii-config.docker.yaml).
Configuration discovery and viewer binding implementation
src/cli.ts, src/viewer/server.ts
findIiiConfig() prioritizes AGENTMEMORY_III_CONFIG and falls back to searching candidate directories for iii-config.yaml; viewer server uses AGENTMEMORY_VIEWER_HOST for server.listen and computes a displayHost that shows localhost when binding to wildcard/loopback addresses.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 I hopped through configs bright and neat,
I nudged the host where viewer meets,
A path for iii I softly place,
So servers bind where devs embrace,
A tiny rabbit leaves no trace.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: making bind hosts for both iii-engine and viewer configurable, which directly matches the changeset modifications.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/viewer/server.ts`:
- Line 124: The displayHost logic is inverted: when host is "0.0.0.0" or "::"
the logged URL should show "localhost" not the raw host; update the ternary that
sets displayHost (the const displayHost = ... line) to return "localhost" for
those all-interface bind addresses and return host for other values so the
printed URL is usable in a browser.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea0a8a69-cf32-4f7e-aa67-58832a6211f0

📥 Commits

Reviewing files that changed from the base of the PR and between 4b354b7 and 8ec35ef.

📒 Files selected for processing (3)
  • README.md
  • src/cli.ts
  • src/viewer/server.ts

Comment thread src/viewer/server.ts Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/viewer/server.ts (1)

9-14: ⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoff

Document VIEWER_ALLOWED_ORIGINS env var to support remote deployment.

The PR enables custom host binding for remote deployment, but ALLOWED_ORIGINS defaults to hardcoded localhost and 127.0.0.1. The VIEWER_ALLOWED_ORIGINS env var exists to override this, but it is not documented in the README. Remote deployments will require setting this env var explicitly, and users won't discover this without documentation or trial-and-error.

Add documentation for the VIEWER_ALLOWED_ORIGINS env var (comma-separated list of allowed origins) to the README or deployment guide.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/viewer/server.ts` around lines 9 - 14, Add documentation for the
VIEWER_ALLOWED_ORIGINS environment variable used to populate ALLOWED_ORIGINS
(comma-separated list of allowed origins) so remote deployments know to set it
rather than rely on the localhost defaults; update the README/deployment guide
with a short section that describes the env var name VIEWER_ALLOWED_ORIGINS,
expected format (e.g., "https://example.com,https://app.example.com"), examples
for common deployment scenarios, and a note that it overrides the hardcoded
localhost/127.0.0.1 defaults used by ALLOWED_ORIGINS in the viewer server.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/viewer/server.ts`:
- Around line 9-14: Add documentation for the VIEWER_ALLOWED_ORIGINS environment
variable used to populate ALLOWED_ORIGINS (comma-separated list of allowed
origins) so remote deployments know to set it rather than rely on the localhost
defaults; update the README/deployment guide with a short section that describes
the env var name VIEWER_ALLOWED_ORIGINS, expected format (e.g.,
"https://example.com,https://app.example.com"), examples for common deployment
scenarios, and a note that it overrides the hardcoded localhost/127.0.0.1
defaults used by ALLOWED_ORIGINS in the viewer server.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26a7a266-6a81-4f05-8940-2c9083d0c236

📥 Commits

Reviewing files that changed from the base of the PR and between 8ec35ef and 455d438.

📒 Files selected for processing (3)
  • README.md
  • src/cli.ts
  • src/viewer/server.ts
✅ Files skipped from review due to trivial changes (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/cli.ts

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.

1 participant