Skip to content

fix(plugin-auth): with objectstack dev -p 0 the auth origin stays http://localhost:0, because kernel:ready reads the port before the server listens #31948

Closed

Description

@objectstack-fleet

domain:server#2 · os-steve · session_01ADHkmQKZzp4DLtqiCkZZRM

Filing gate: ① a product defect with a named seam and a measured reach. It is an out-of-scope finding of #31904 (PR #31946, report issuecomment-6741956757). ⛔ Not a claim.

维护者速读

  • 问题:用 objectstack dev -p 0(让系统分配随机端口)启动时,认证模块在服务器真正开始监听之前就读取端口,读到 0,于是认证的对外地址停在 http://localhost:0,而服务器实际监听的是另一个随机端口。
  • 影响:开发时用随机端口的话,邀请链接、登录与重置密码邮件里的地址是错的。
  • 需要你做的:无,由车道处理。

Reach (measured on PR #31946's head and on the same code path on main)

  • objectstack dev --fresh -p 0 (examples/app-todo): AuthPlugin's kernel:ready port correction calls getPort() before the transport listens. It answers 0, so the correction is skipped (if (actualPort)), and the auth origin stays http://localhost:0. The log then shows HTTP server started ... port 43409 after Auth routes registered.
  • fix(plugin-auth): keep a configured http://localhost base URL as written #31946 does not change this path: with no base URL configured, the correction is still asked, but it is asked too early.

Work

  1. The port correction for an unconfigured base URL runs once the transport has bound its port, or reads the bound port from a seam that already has it. It does not read a port the server has not opened yet.
  2. Tests: a boot with port 0 and no base URL configured ends with the auth origin on the port the server bound. RED on main.

Dedupe: "auth base url localhost:0 port 0", "kernel:ready getPort 0 before listen": none on point.

Activity

  1. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-bill · session_01Utp6CX9R5BLZwgJDeivmA7

    Claim: PM loop round 1 · takeover of a released card on the maintainer's word
    Provenance: the maintainer (Bill), verbatim 「接手 32081 32194」, project "Objectstack server 31527 devx", project timeline, 2026-11-12T03:46Z. Previous claim 6765173746 (session_012dn2Ae4fomvXPZ2AioCpY4, os-bob, domain:server#5) was already released at 6776921470; nothing live is withdrawn here.
    Session: session_01Utp6CX9R5BLZwgJDeivmA7 (seat; S mechanical, done in-seat: merge origin/main into the PR through the relay pr_update_branch, no new code)
    Account: os-bill
    Branch: claude/issue-31948-auth-origin-bound-port
    Worktree: none (relay merge of main; a card thread is opened only if CI turns red on code)
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/plugins/plugin-auth/src/auth-plugin.ts + its test (PR #32194 as ACCEPTed; stop on breach)
    Container & model: S, mode:subagent (in-seat), model: default, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: platform code in objectstack (plugin-auth) produces the risk · no platform path covers it · a developer running objectstack dev -p 0 or on a shifted dev port reaches it today
    Thread-read: 6776921470
    Premise: holds (ACCEPT 6769166980 at ed5789eed7; the fix is complete as reviewed)
    Serial constraints cleared: none on plugin-auth/src/auth-plugin.ts among this lane's in-flight claims.
    Resume-from: claude/issue-31948-auth-origin-bound-port@ed5789eed7c300188221a6662b798b161d34f126
    Restart-when check: the parked line (6773650390) waits on the security owner seat's item behind the merge-queue failure (Dogfood activity-parent-read-gate). The maintainer's takeover word reopens the card; the seat measures the condition by merging origin/main and reading that check on the new head. Red there for the same reason ⇒ the card goes back to pm:on-hold on the same line, nothing narrowed.

  2. added
    pm:dispatched
    and removed
    pm:on-hold
    on Nov 12, 2026
  3. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-bill · session_01Utp6CX9R5BLZwgJDeivmA7

    ACCEPT → PR #32194 comment 6814313742(沿用 6769166980,净 diff 不变,已入队)。

  4. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-bill · session_01Utp6CX9R5BLZwgJDeivmA7

    Parked · 2026-11-12T04:36Z · PR #32194 (head c42c6a7945ed640d8b57dbe439bed385d962d807, merge-of-main head, net code diff identical to ACCEPT head ed5789eed7). pm:dispatched → pm:on-hold. Claim 6813815799 stands; the PR is back to draft and out of the queue.

    • Measured: the merge queue dequeued PR fix(plugin-auth): an unconfigured auth origin ends on the port the server bound, not the port it was asked for #32194 at 2026-11-12T04:32Z on CI_FAILURE. Queue branch gh-readonly-queue/main/pr-32194-9009270cc1… (09bdf06497): Dogfood Regression Gate (1/3) failed on test/activity-parent-read-gate.dogfood.test.ts — activity row … is about sys_oauth_resource/…: expected 404 to be 200, the same signature as the 11-10 park (6773650390). Only that one test failed (1 failed | 1238 passed).
    • Why park, not narrow: the defect the red exposes is on the activity-gate side (the corrected-origin sys_oauth_resource seed gets an org-stamped activity row the member cannot open), as the dev showed in 6773563945. The PR's fix stays as reviewed.

    Restart-when: the security owner seat reports that the item behind this card's merge-queue failure (Dogfood activity-parent-read-gate, sys_oauth_resource activity row) has merged; then merge main into PR #32194, re-run, and land on ACCEPT 6769166980.

  5. added
    pm:on-hold
    and removed
    pm:dispatched
    on Nov 12, 2026
  6. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-sales · session_01L6bhgVaKJ9TPfXPRhdqx3e

    Release: claim 6813815799 (domain:server#5 · os-bill · seat session session_01Utp6CX9R5BLZwgJDeivmA7, dev session session_01Utp6CX9R5BLZwgJDeivmA7) is withdrawn by takeover.
    Provenance: the maintainer, verbatim 「开座位接手 objectstack-ai/objectstack 的专题 #31527(ADR-0150)…再开 2 个 server 座位接卡」 (project "Objectstack security ui", project timeline, 2026-11-12T12:24:11Z), with the outgoing holder's handover to "a new server seat on another account" at 6823237839 (server seat 5 section). The seats split the handover at the seating comment 6823665821 on #6367.

    Claim: PM loop round 1 · takeover of a live claim on the maintainer's word
    Session: session_01L6bhgVaKJ9TPfXPRhdqx3e (seat; the card's next dev or card thread is named in a claim amendment before it starts)
    Account: os-sales
    Branch: claude/issue-31948-auth-origin-bound-port
    Worktree: none (relay merge of main; a card thread is opened only if CI turns red on code)
    Domain: domain:server
    Seat: domain:server#1
    File surface: packages/plugins/plugin-auth/src/auth-plugin.ts + its test (PR #32194 as ACCEPTed; stop on breach)
    Container & model: S, mode:subagent (in-seat), model: default, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: platform code in objectstack (plugin-auth) produces the risk · no platform path covers it · a developer running objectstack dev -p 0 or on a shifted dev port reaches it today
    Thread-read: 6814661119
    Premise: holds (ACCEPT 6769166980 at ed5789eed7; the fix is complete as reviewed)
    Serial constraints cleared: none on plugin-auth/src/auth-plugin.ts among this lane's in-flight claims.
    Restart-when check: the parked line (6773650390) waits on the security owner seat's item behind the merge-queue failure (Dogfood activity-parent-read-gate). The maintainer's takeover word reopens the card; the seat measures the condition by merging origin/main and reading that check on the new head. Red there for the same reason ⇒ the card goes back to pm:on-hold on the same line, nothing narrowed.
    Resume-from: claude/issue-31948-auth-origin-bound-port@c42c6a7945ed640d8b57dbe439bed385d962d807

    Handover record: last pushed claude/issue-31948-auth-origin-bound-port@c42c6a7945ed640d8b57dbe439bed385d962d807 (read with git ls-remote at this takeover). State: PR #32194 draft, pm:on-hold; waits on the security owner's activity-gate item (merge-queue failure in Dogfood activity-parent-read-gate); the hold and its Restart-when line are unchanged.

  7. objectstack-fleet commented on Nov 13, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Restart · pm:on-hold → pm:dispatched (claim by domain:server#1 stands) · 2026-11-13T07:02Z


    Generated by Claude Code

  8. added
    pm:dispatched
    and removed
    pm:on-hold
    on Nov 13, 2026
  9. objectstack-fleet commented on Nov 13, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-sales · session_01L6bhgVaKJ9TPfXPRhdqx3e

    Landed: PR #32194 merged as 4aceae5f3 (ACCEPT 6853289242, carrying 6769166980; the net code diff unchanged since). The card closed with the merge (Fixes #31948).

    State: pm:dispatched removed; card closed.

  10. removed
    pm:dispatched
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:serverpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions