Skip to content

release: ensure_config targets payram.server.url; node-status + SCW deploy hardening - #83

Open
BuddhaSource wants to merge 7 commits into
mainfrom
develop
Open

release: ensure_config targets payram.server.url; node-status + SCW deploy hardening#83
BuddhaSource wants to merge 7 commits into
mainfrom
develop

Conversation

@BuddhaSource

Copy link
Copy Markdown
Contributor

Release develop → main.

Contains PR #82 (root-cause fix for payment-link 500s):

  • ensure_config now sets the canonical payram.server.url via POST /system/site-url (legacy split-key fallback for older cores)
  • deploy-scw-eth.js validates PAYRAM_PROJECT_ID before the deploy tx spends gas
  • node-status tolerates missing worker status (no more false listener-down on supervisord-less hosts)
  • PAYRAM_HEADLESS_AGENT.md updated to match

setup_payram.sh untouched (0 lines vs main).

🤖 Generated with Claude Code

https://claude.ai/code/session_01S2XQq28ZNuUWMWAM2HL6qu

…ut project id

Core collapsed payram.frontend/payram.backend into one canonical
payram.server.url and hard-deletes the legacy keys on boot, so
ensure_config's writes had become silent no-ops — and a payram.server.url
left unset makes POST /payment return 500 at link creation. ensure_config
now checks GET /system/site-url and, when siteUrl is null, POSTs the
canonical endpoint (root-only; core derives the origin from the request,
only the scheme is sent). Non-200 on GET falls back to the legacy split
keys so the script still works against older images.

deploy-scw-eth.js: current core registers SCWs only on the
project-scoped route, so an empty PAYRAM_PROJECT_ID used to fail
registration AFTER the deploy tx had burned gas. The project id is now
validated before sending the transaction.
…re-config

GET /system/workers/status returns 500 on hosts without supervisord;
node-status previously fed that error body into every chain check,
degrading each to listener-down with a bogus restart remediation and
exit 1. Worker status is now best-effort: on non-200 the listener state
prints as 'unknown', the listener-down downgrade is suppressed, and the
RPC/block-age checks still run.

Docs: PAYRAM_HEADLESS_AGENT.md now describes ensure-config's canonical
payram.server.url behaviour (legacy keys only as the older-core
fallback).
fix: ensure_config targets payram.server.url; SCW deploy fails fast without project id
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2d7b0daf-f5be-463e-acb9-9929654de3c4

📥 Commits

Reviewing files that changed from the base of the PR and between 7192285 and 127b054.

📒 Files selected for processing (1)
  • updater-configs/upgrade-policy.json

Summary by CodeRabbit

  • Bug Fixes
    • Improved setup status reporting when worker information is unavailable, avoiding incorrect listener-down inference.
    • Setup now prefers the canonical server URL and safely falls back to legacy config when needed.
    • Setup flow continues with a warning if server URL configuration can’t be completed.
  • Deployment
    • Deployment now requires a project ID and validates factory details (including a non-empty factory ID) before on-chain submission.
    • Project-scoped registration is attempted first, with legacy fallback if the scoped endpoint fails.
  • Documentation
    • Clarified agent one-step flow to ensure the server URL used for payment-link creation.
  • Chores
    • Updated upgrade policy: latest is now 3.5.2 (and added 3.5.1/3.5.2 entries).

Walkthrough

The changes update agent setup documentation and behavior, tolerate unavailable worker-status endpoints, strengthen SCW deployment prerequisites and registration routing, and set version 3.5.2 as the latest upgrade-policy release.

Changes

Agent configuration and status

Layer / File(s) Summary
Optional worker-status handling
setup_payram_agents.sh
Worker-status failures now produce unavailable worker data, and listener state is reported as unknown instead of inferring listener-down.
Canonical server URL configuration
setup_payram_agents.sh, docs/PAYRAM_HEADLESS_AGENT.md
ensure-config uses /system/site-url to set payram.server.url, retains legacy fallback behavior, tolerates configuration failure in the main flow, and updates the documentation.

SCW deployment registration

Layer / File(s) Summary
Project-scoped registration
scripts/deploy-scw-eth.js
Deployment now requires factoryId and PAYRAM_PROJECT_ID, then tries the project-scoped registration endpoint before the legacy endpoint.

Release upgrade policy

Layer / File(s) Summary
Version 3.5.2 policy
updater-configs/upgrade-policy.json
The policy adds releases 3.5.2 and 3.5.1 and updates both latest and dashboard_max to 3.5.2.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: sam6230i

Poem

A rabbit hops where configs align,
The server URL now follows the sign.
Workers may whisper, “unknown” today,
Project paths guide deployment’s way.
Three-five-two joins the parade—
Neat little scripts, freshly upgraded.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: config URL handling, node-status hardening, and SCW deploy validation.
Description check ✅ Passed The description matches the changeset and accurately describes the main fixes and documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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

@BuddhaSource BuddhaSource self-assigned this Jul 25, 2026
@BuddhaSource
BuddhaSource requested a review from sam6230i July 25, 2026 19:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/deploy-scw-eth.js`:
- Around line 163-166: Update the preflight validation in the deployment flow
before the transaction is sent to require factoryData.id (factoryId) to be
non-null and non-blank, alongside the existing factory address and ABI checks.
Abort deployment when the ID is invalid so the registration URLs built in the
candidates array never contain an undefined or empty identifier.

In `@setup_payram_agents.sh`:
- Around line 1301-1307: Update the server URL POST handling in the
ensure-config flow so HTTP 403 and other non-200 responses return failure
instead of reaching the unconditional return 0. Preserve the successful 200
path, and ensure the function’s final status reflects whether the canonical
server URL was actually set.
🪄 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: 0c37bda2-3c11-44ba-9253-bb421bff36c1

📥 Commits

Reviewing files that changed from the base of the PR and between 073d890 and 03c7ca1.

📒 Files selected for processing (3)
  • docs/PAYRAM_HEADLESS_AGENT.md
  • scripts/deploy-scw-eth.js
  • setup_payram_agents.sh

Comment thread scripts/deploy-scw-eth.js
Comment thread setup_payram_agents.sh
…eploy

From the CodeRabbit review on release PR #83:
- ensure_config returned 0 even when POST /system/site-url failed, so
  the ensure-config command reported success while payment-link
  creation stayed broken. Non-200 now returns 1; the full agent flow
  tolerates it with a warning so wallet/gas setup still proceeds.
- deploy-scw-eth.js validated address+abi but not factoryData.id, which
  forms the registration URL — a malformed backend response could burn
  deploy gas then POST to /undefined. The preflight now requires it.
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