Skip to content

feat: owner sync, config-event persistence, version-check notify#13

Merged
Noah-Bytes merged 2 commits into
mainfrom
feat/owner-sync-config-events-version-check
Jul 21, 2026
Merged

feat: owner sync, config-event persistence, version-check notify#13
Noah-Bytes merged 2 commits into
mainfrom
feat/owner-sync-config-events-version-check

Conversation

@Noah-Bytes

Copy link
Copy Markdown
Collaborator

Port three adapter logics from zylos-openmax (reference), adapted to codex-openmax's TS thin-adapter over @openmaxai/openmax-agent-sdk:

  • runtime-config: mutable config provider + atomic persist (single on-disk writer)
  • config-events: onConfigEvent switch persists agent.config.* (dm/group policy, allowlists, owner_changed) — previously silently dropped
  • owner-sync: real syncSelf hydrates self display_name + owner_member_id from cws-core (pull-based, never clears a locally-set owner); 5-min periodic re-sync; onOwnerBind/onOwnerNameHint wired
  • version-check (opt-in, default off): npm-registry latest vs local, DM owner on a newer release; never self-upgrades

Tests: +27 (173 total). build + typecheck + vitest all green.

What

Why

Test plan

  • npm test passes locally
  • npm run build passes locally

Checklist

  • No secrets / credentials committed
  • Semgrep / Gitleaks findings addressed, or a // nosemgrep: <rule-id> suppression is justified inline and approved by the project lead

Noah-Bytes and others added 2 commits July 21, 2026 23:38
Port three adapter logics from zylos-openmax (reference), adapted to codex-openmax's TS thin-adapter over @openmaxai/openmax-agent-sdk:

- runtime-config: mutable config provider + atomic persist (single on-disk writer)
- config-events: onConfigEvent switch persists agent.config.* (dm/group policy, allowlists, owner_changed) — previously silently dropped
- owner-sync: real syncSelf hydrates self display_name + owner_member_id from cws-core (pull-based, never clears a locally-set owner); 5-min periodic re-sync; onOwnerBind/onOwnerNameHint wired
- version-check (opt-in, default off): npm-registry latest vs local, DM owner on a newer release; never self-upgrades

Tests: +27 (173 total). build + typecheck + vitest all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@gavin09527 gavin09527 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed against openmax-agent-sdk@1.0.1 (ebaa356). LGTM — this is the correct fix for the group-message-rejection root cause (previously agent.config.* frames were silently dropped: no onConfigEvent wiring + no persistence layer).

Verified:

  • SDK callback contracts all match: syncSelf(orgConfig) (self-name-hydration.js:86), onConfigEvent(orgConfig, {event,data,frame}) (orchestrator.js:550, rejection awaited+retried on replay per P1-3 test — matches the "let it throw" comment), onOwnerBind(orgId,memberId,displayName) (:435), onOwnerNameHint(orgId,name) (:438), loadConfig()→{orgs} org_id-keyed (:222). createDm({peerMemberId}) alias + send({conversationId,content}) match comm.js.
  • Security: owner_changed never trusts the pushed frame — it only triggers a pull-based re-sync from core (tested with a forged attacker_999 frame). Good.
  • Idempotency: applyBoth runs the mutation on both the provider record and the SDK live copy (same object in normal wiring → double-applied); every case is assignment-only, so double application is safe. Verified each branch.
  • Persistence: assembleOnDisk reproduces every block loadConfig reads (server/agent/cf_access/orgs/codex/bridge/version_check) → round-trips; atomic 0o600 write preserves secrets. Disabled orgs still written to disk.
  • version-check: opt-in, default off, never self-upgrades, prerelease-aware semver, per-(org,version) dedupe. Fail-open.

CI green (Test/Semgrep/Gitleaks), +27 tests. No blocking issues.

@Noah-Bytes
Noah-Bytes merged commit 22089b1 into main Jul 21, 2026
3 checks passed
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