Skip to content

update docs#74

Merged
batuhan merged 8 commits intomainfrom
batuhan/docs
Mar 24, 2026
Merged

update docs#74
batuhan merged 8 commits intomainfrom
batuhan/docs

Conversation

@batuhan
Copy link
Member

@batuhan batuhan commented Mar 22, 2026

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 586f1f12-dee3-4474-9111-532625918c67

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
📝 Walkthrough

Walkthrough

This PR refactors documentation to reframe AgentRemote as a bridge layer, adds CLI-focused install/release/CI artifacts, introduces OpenClaw gateway discovery and provisioning (mDNS/avahi support and prefilled login flows), updates many bridge READMEs/specs to simplified modes, and adds Docker/homebrew packaging scripts and workflows.

Changes

Cohort / File(s) Summary
Root docs & CLI
README.md, docs/bridge-orchestrator.md, install.sh
Rewrote README to a CLI/bridge-focused framing, simplified quick-start and SDK references; re-scoped Bridge Orchestrator doc to AgentRemote CLI; added install.sh installer.
Bridge READMEs
bridges/codex/README.md, bridges/openclaw/README.md, bridges/opencode/README.md
Renamed/reframed bridge docs to present Beeper→runtime connection, simplified login/run sections and removed detailed notes.
OpenClaw core & discovery
bridges/openclaw/... (config.go, connector.go, discovery.go, discovery_provisioning.go, login_prefill.go, manager.go, gateway_client.go, login.go, metadata.go, status.go, catalog.go, example-config.yaml)
Added mDNS/wide-area gateway discovery, provisioning endpoint returning discovered gateways + login prefill flows, prefills state and TTL, discovery config, client identity and capability probing, history fallback, stream/tool/approval refactors, removed inbound control-command parsing, and related metadata adjustments.
OpenClaw tests
bridges/openclaw/*_test.go (discovery_test.go, gateway_client_test.go, login_test.go, manager_test.go, stream_test.go, commands_test.go)
Added and updated unit tests covering discovery, prefill logic, client connect/signature, session-history fallback, login credential flows, compatibility reporting, and stream/tool metadata handling.
OpenClaw removal/cleanup
bridges/openclaw/client.go, bridges/openclaw/commands_test.go
Removed sendSystemNoticeViaPortal and replaced inbound command parsing tests with outbound payload tests.
Specs: Matrix / MSCs
docs/matrix-ai-matrix-spec-v1.md, docs/msc/com.beeper.mscXXXX-commands.md, docs/msc/com.beeper.mscXXXX-ephemeral.md, docs/msc/com.beeper.mscXXXX-streaming.md
Heavily condensed long-form specs to concise “what we emit” descriptions: simplified streaming/delta envelopes, command profile overview, ephemeral status note, and reduced compaction/streaming details.
SDK & tests
sdk/part_apply.go, sdk/part_apply_test.go, sdk/turn_test.go
Preserve whitespace in deltas/raw fields, add preliminary streaming handling for tool outputs, and new tests validating preserved whitespace and preliminary/final tool outputs.
Docker & packaging
docker/agentremote/Dockerfile, docker/agentremote/README.md, tools/generate-homebrew-cask.sh
Added Dockerfile and image README, plus Homebrew cask generator script for release automation.
CI / Releases
.github/workflows/docker-agentremote.yml, .github/workflows/publish-release.yml, .github/workflows/go.yml, .goreleaser.yml (removed)
Added Docker publish and release workflows, package-smoke job, publish-release flow including checksums and Homebrew tap update; removed GoReleaser config.
Misc
go.mod
Bumped maunium.net/go/mautrix indirect dependency version.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as AgentRemote CLI
  participant Prov as Provisioning API (./tools/bridges)
  participant Disc as Discovery Runner (dns-sd / avahi)
  participant GW as OpenClaw Gateway
  participant OC as OpenClawConnector

  CLI->>Prov: GET /v1/discovery/gateways?wide_area=...
  Prov->>Disc: run discovery (timeout)
  Disc-->>Prov: discovered gateway metadata
  Prov->>OC: registerLoginPrefill(user, url, label)
  OC-->>Prov: flowID + expiry
  Prov-->>CLI: discovery response with prefill flow
  CLI->>CLI: user selects prefilled login (flowID)
  CLI->>OC: CreateLogin using prefill flowID
  OC->>GW: connect/login using gateway URL/token
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.95% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'update docs' is vague and generic. While documentation changes are present, the title does not convey meaningful information about the substantive changes (architectural reframing, CLI-focused content, bridge discovery features, release workflows, etc.). Use a more specific title that describes the main changes, such as 'Reframe AgentRemote as bridge layer and add OpenClaw discovery' or 'Update documentation and add CI/CD release workflows'.
Description check ❓ Inconclusive No pull request description was provided by the author. Without a description, it is impossible to assess whether the author's intent aligns with the changeset. Add a pull request description explaining the changes, such as the reframing of AgentRemote, the addition of OpenClaw discovery, and the new release workflows.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch batuhan/docs

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

Copy link

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/bridge-orchestrator.md`:
- Around line 15-17: Replace the insecure example that passes a bearer token on
the command line (the `./tools/bridges auth set-token --token ... --env prod`
usage) with a safer pattern: show using an environment variable (e.g., export
BRIDGE_TOKEN=...), a prompt/interactive flow (e.g., `./tools/bridges auth
set-token` which prompts for the token), or reading from a protected file (e.g.,
`./tools/bridges auth set-token --file /path/to/secret`), and make one of those
the primary example while keeping a note about avoiding `--token` on the command
line; update the docs lines that mention `./tools/bridges auth set-token
--token` and any help text recommending `--token` to instead reference
`BRIDGE_TOKEN`, interactive prompt, or `--file`.

In `@docs/msc/com.beeper.mscXXXX-streaming.md`:
- Around line 61-63: The doc currently says "`seq` is strictly positive and
monotonic per turn" which is ambiguous; update the wording to explicitly require
that `seq` is strictly increasing (i.e., each subsequent `seq` value for the
same `turn_id` must be greater than the previous one), and keep the other
constraints (`turn_id` is required, `part` is required) unchanged so clients
know to reject non-increasing or equal `seq` values.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 02f2b442-f608-4831-a6a7-dc396781df8c

📥 Commits

Reviewing files that changed from the base of the PR and between 14bc6a6 and d80e9f8.

📒 Files selected for processing (9)
  • README.md
  • bridges/codex/README.md
  • bridges/openclaw/README.md
  • bridges/opencode/README.md
  • docs/bridge-orchestrator.md
  • docs/matrix-ai-matrix-spec-v1.md
  • docs/msc/com.beeper.mscXXXX-commands.md
  • docs/msc/com.beeper.mscXXXX-ephemeral.md
  • docs/msc/com.beeper.mscXXXX-streaming.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Lint
  • GitHub Check: build-docker
  • GitHub Check: build-docker
🔇 Additional comments (10)
bridges/opencode/README.md (1)

1-39: Clear and consistent bridge-mode documentation.

The mode split (remote vs managed) and login prompts are easy to follow, and the run instructions are still straightforward.

bridges/codex/README.md (1)

1-35: Good cleanup and alignment with bridge docs.

The runtime framing, login modes, and CODEX_HOME behavior are documented clearly and match the simplified doc style.

docs/msc/com.beeper.mscXXXX-ephemeral.md (1)

3-9: Status note is concise and unambiguous.

This clearly communicates that com.beeper.ephemeral is currently out of scope and points readers to the active streaming model.

bridges/openclaw/README.md (1)

1-31: Solid bridge-focused rewrite.

The transport/login flow is clearer now, especially the device-pairing note and request ID behavior.

README.md (1)

3-50: Top-level README is much clearer and easier to scan.

The bridge table, quick start, and SDK pointers provide a strong entry path without overloading details.

docs/msc/com.beeper.mscXXXX-commands.md (1)

1-34: Compact and practical command-profile spec.

The structured-vs-plaintext precedence and built-in command table are clear for implementers and clients.

docs/matrix-ai-matrix-spec-v1.md (4)

1-3: Clear scope and status framing.

The intro cleanly sets experimental status and narrows the doc to emitted transport behavior, which matches the PR’s documentation re-scope.

Also applies to: 5-15


16-31: Streaming and persistence semantics are well specified.

The canonical m.room.message + com.beeper.ai shape, com.beeper.llm delta envelope, and finalization authority are concise and internally consistent.

Also applies to: 33-70


71-87: Compaction/metadata sections are concise and implementation-oriented.

The reduced compaction field list and “Extra keys/Notes” guidance are clear and appropriately scoped for a transport spec.

Also applies to: 91-106


89-89: The relative link to ./msc/com.beeper.mscXXXX-commands.md is valid and the target file exists with the expected content about org.matrix.msc4391.command_description. No issues detected.

Comment on lines +15 to +17
- `./tools/bridges login --env prod`
- `./tools/bridges auth set-token --token syt_... --env prod`
- `./tools/bridges whoami`
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid documenting bearer tokens in command-line arguments.

Passing tokens via --token ... encourages leaking secrets through shell history and command inspection. Please document a safer input path (prompt/env/file) as the primary example.

Suggested doc tweak
 - `./tools/bridges login --env prod`
-- `./tools/bridges auth set-token --token syt_... --env prod`
+- `./tools/bridges auth set-token --env prod`  # enter token via prompt (preferred)
 - `./tools/bridges whoami`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/bridge-orchestrator.md` around lines 15 - 17, Replace the insecure
example that passes a bearer token on the command line (the `./tools/bridges
auth set-token --token ... --env prod` usage) with a safer pattern: show using
an environment variable (e.g., export BRIDGE_TOKEN=...), a prompt/interactive
flow (e.g., `./tools/bridges auth set-token` which prompts for the token), or
reading from a protected file (e.g., `./tools/bridges auth set-token --file
/path/to/secret`), and make one of those the primary example while keeping a
note about avoiding `--token` on the command line; update the docs lines that
mention `./tools/bridges auth set-token --token` and any help text recommending
`--token` to instead reference `BRIDGE_TOKEN`, interactive prompt, or `--file`.

Comment on lines +61 to +63
- `turn_id` is required
- `seq` is strictly positive and monotonic per turn
- `part` is required
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify seq ordering to avoid ambiguous client behavior.

“Monotonic” can be read as non-decreasing; for stream replay/ordering safety, this should explicitly require strictly increasing sequence numbers.

Suggested wording fix
-- `seq` is strictly positive and monotonic per turn
+- `seq` is strictly increasing per turn (1, 2, 3, ...)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `turn_id` is required
- `seq` is strictly positive and monotonic per turn
- `part` is required
- `turn_id` is required
- `seq` is strictly increasing per turn (1, 2, 3, ...)
- `part` is required
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/msc/com.beeper.mscXXXX-streaming.md` around lines 61 - 63, The doc
currently says "`seq` is strictly positive and monotonic per turn" which is
ambiguous; update the wording to explicitly require that `seq` is strictly
increasing (i.e., each subsequent `seq` value for the same `turn_id` must be
greater than the previous one), and keep the other constraints (`turn_id` is
required, `part` is required) unchanged so clients know to reject non-increasing
or equal `seq` values.

batuhan added 6 commits March 22, 2026 21:03
Introduce a gatewayClientIdentity and resolver helpers to derive client ID, version, platform, device family, instance ID and user-agent. Wire the identity into websocket dial headers, connect params, HTTP requests, and the signed device payload (so visible client metadata is covered by the device signature). Change default client constants (ID -> "beeper-bridge", mode -> "ui", display name -> "Beeper") and remove sessions.patch from preferred gateway methods. Remove legacy OpenClaw slash-command parsing and session-patch handling from manager; update tests to verify slash commands (/model, /stop) pass through, to check presence of instanceId/userAgent, and to assert the device signature covers visible client metadata.
Update maunium.net/go/mautrix to pseudo-version v0.26.5-0.20260323230949-0eafa0ba2e5d in go.mod and add the corresponding checksums to go.sum. This brings in the newer upstream commit for mautrix.
@batuhan batuhan merged commit 3568da1 into main Mar 24, 2026
9 of 10 checks passed
@batuhan batuhan deleted the batuhan/docs branch March 24, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant