Repository navigation
feat(cli): serve --bind to choose the listen address (port of nerdsane#537) - #36
Conversation
…ed: 0.0.0.0) (nerdsane#537) * refactor(cli): split serve option resolvers and the Observe UI spawn into modules main.rs and serve/mod.rs sit just under the 1000-line readability ratchet; the --bind option would push both over it. Move the flag/env resolvers to serve/options.rs and the Observe UI spawn to serve/observe_ui.rs. No behavior change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(cli): serve --bind to choose the listen address (default unchanged: 0.0.0.0) `temper serve` always bound 0.0.0.0, so a single-user server reached through an SSH tunnel or a local proxy had to be fenced off with firewall rules. --bind <ip> picks the address; TEMPER_BIND_ADDR selects it when the flag is not given, with the same precedence the storage and actor-runtime options use. Only 0.0.0.0 and 127.0.0.1 are accepted: Temper's own components (the Observe UI proxy, WASM host self-calls, the blob endpoint, the Discord transport) reach the API at http://127.0.0.1:{port}, so any other address would bind a server those callers cannot reach; a host name is refused rather than resolved. The Observe UI port probe and dev server and the auto-started local sandbox follow the chosen address, so --bind 127.0.0.1 leaves no listener on 0.0.0.0. Opt-in and backward compatible: without the flag or the variable nothing changes, and the startup line still names the address that was bound. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit 118bb6f) Ported from nerdsane/temper to arni-labs/temper. Two conflicts in serve/mod.rs: kept arni-labs' Turso Sync copy wrapper around the router and the state-timer re-arm before serving, with the listener and its banner on the chosen address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| parser.add_argument( | ||
| "--host", type=str, default="0.0.0.0", | ||
| help="Address to bind (default: 0.0.0.0; 127.0.0.1 for loopback only)" | ||
| ) |
There was a problem hiding this comment.
Agent code extends outside temperpaw
Adding --host extends the agent sandbox in this repository. The repository guide says kernel code belongs here and app and agent logic belongs in temperpaw. Put this helper change in temperpaw and connect the CLI to that maintained helper. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: os-apps/temper-agent/sandbox/local_sandbox.py
Line: 138-141
Comment:
**Agent code extends outside temperpaw**
Adding `--host` extends the agent sandbox in this repository. The repository guide says kernel code belongs here and app and agent logic belongs in temperpaw. Put this helper change in temperpaw and connect the CLI to that maintained helper. This repository requirement must be satisfied before merging.
**Context Used:** CLAUDE.md ([source](https://github.com/arni-labs/temper/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
End-to-end check, 21 Oct 00:05 UTC, debug build of ed90da4 on macOS (port 37461,
The two refused runs print, in order: |
…bind Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vn3nVUWRTUBZZm9DxvTmAa
Port of nerdsane/temper 118bb6f (nerdsane#537, 19 Oct):
temper serve --bind <ip>chooses the listen address. The default stays 0.0.0.0.What it does
--bind 127.0.0.1(orTEMPER_BIND_ADDR, when the flag is absent) makes the server listen on loopback only. The precedence matches the storage and actor-runtime options.0.0.0.0and127.0.0.1are accepted. Temper's own callers (the Observe UI proxy, WASM self-calls, the blob endpoint, the Discord transport) reach the API at 127.0.0.1, and a host name is refused.serve/options.rsand the Observe UI start toserve/observe_ui.rs, somain.rsandserve/mod.rsstay under the readability limit.Port notes
It merged into arni-labs main (c8f92d3) with two conflicts in
serve/mod.rs, both resolved to keep arni-labs' code:sync_copy::answer_after_copy) and bindsSocketAddr::from((bind, port)).rearm_state_timers, ADR-0056) still runs before serving. The banner prints the chosen address.Merge after tonight's kernel binary is cut, so the roll's contents stay as reviewed.
Checks
temper servewith no flag, with--bind 127.0.0.1, withTEMPER_BIND_ADDR=127.0.0.1, and with a bad value. Each time, read what is listening withlsof.🤖 Generated with Claude Code
The kernel-only requirement in previous finding 1 still needs to be satisfied before merging.
Fix with agent prompt
Summary
Adds
temper serve --bindandTEMPER_BIND_ADDR, while keeping the default address unchanged.No new findings were accepted. The merge bases differ, so the full PR diff was reviewed as changes since the last review.
Reviews (2) · Last reviewed commit: "Merge arni-labs/main (client spans and l..." · Reviewed by Greptile