Skip to content

machweb: serve_on_quiet, for a caller that announces its own bind - #674

Merged
javimosch merged 1 commit into
mainfrom
machweb-serve-on-quiet
Sep 25, 2026
Merged

javimosch merged 1 commit into
mainfrom
machweb-serve-on-quiet

Conversation

@javimosch

@javimosch javimosch commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

serve_on prints machweb on http://host:port to stdout. The agent-first
CLI contract puts that line on stderr — it is context, not data — and a
service whose stdout is JSON hands a parser a log line on startup.

This adds a silent variant rather than changing what existing callers do: same
bind, same exit-on-bind-failure, no announcement. The caller decides where its
own startup line goes.

machin-bkn uses it to meet cli-daemon-spec §1, which requires the
confirmation on stderr and nothing on stdout. Verified there: stdout is
empty, stderr carries [serve] listening on http://127.0.0.1:PORT, and the
191-assertion contract suite still passes.

Additive — no existing behaviour changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJdASnjD4R5h6xX2fzfMfk

Summary by CodeRabbit

  • New Features
    • Added a server startup option that suppresses the startup banner. If binding fails, the server reports an error and exits with a failure status.

serve_on prints "machweb on http://host:port" to stdout. The agent-first CLI
contract puts that line on stderr -- it is context, not data -- and a service
whose stdout is JSON hands a parser a log line on startup.

Rather than change what every existing caller does, this adds a silent
variant. Same bind, same exit-on-failure, no announcement: the caller decides
where its own startup line goes.

machin-bkn uses it to meet cli-daemon-spec §1, which requires the line on
stderr and nothing on stdout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJdASnjD4R5h6xX2fzfMfk
@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 Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 4eb50138-c32d-46a7-8563-24ec9530562d

📥 Commits

Reviewing files that changed from the base of the PR and between b407ebe and 49c030f.

📒 Files selected for processing (1)
  • framework/machweb.src

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds serve_on_quiet(host, port, handler). It serves accepted connections without printing a startup banner. If binding fails, it writes a JSON error to stderr and exits with status 1.

Changes

Machweb server startup

Layer / File(s) Summary
Quiet server entry point
framework/machweb.src
Adds serve_on_quiet, which binds to the specified host and port and dispatches accepted connections to machweb_handle in goroutines. It omits the startup banner. On bind failure, it writes a JSON error to stderr and exits with status 1.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 49c03

The quiet entry point leaves request serving and bind-failure behavior intact while avoiding a startup banner. No merge-blocking risk is evident.

Architecture Summary

Architecture risk: 🔵 Low · up to 49c03

The change affects 1 system.

Changed systems: framework

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — framework (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in framework/machweb.src: Added serve_on_quiet, which listens on the specified host and port and dispatches accepted connections to machweb_handle in goroutines. Unlike serve_on, it omits the startup announcement; on bind failure it writes a JSON error to stderr and exits with status 1.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding the silent serve_on_quiet variant for callers that announce their own bind.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@javimosch
javimosch merged commit 9e0fb93 into main Sep 25, 2026
2 checks passed
@javimosch
javimosch deleted the machweb-serve-on-quiet branch September 25, 2026 05:40
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