fix(session): exclude orphan org members from native pages - #804
Open
ShiboSheng wants to merge 2 commits into
Open
fix(session): exclude orphan org members from native pages#804ShiboSheng wants to merge 2 commits into
ShiboSheng wants to merge 2 commits into
Conversation
ShiboSheng
force-pushed
the
fix/issue-803-orphan-coordinator-pagination
branch
from
September 1, 2026 12:49
c9ef9ba to
e65d3cf
Compare
ShiboSheng
changed the base branch from
develop
to
fix/issue-840-startup-compatibility
September 1, 2026 12:51
ShiboSheng
force-pushed
the
fix/issue-803-orphan-coordinator-pagination
branch
from
September 1, 2026 17:00
e65d3cf to
be06028
Compare
ShiboSheng
force-pushed
the
fix/issue-803-orphan-coordinator-pagination
branch
from
September 1, 2026 19:15
be06028 to
ba56cdb
Compare
ShiboSheng
marked this pull request as ready for review
September 1, 2026 20:46
ShiboSheng
marked this pull request as draft
September 1, 2026 20:50
Filter membership-marked native rows before pinned page limits unless a persisted Agent Org runtime run proves the row is a valid root. Preserve the standalone behavior supplied by the PR 1190 base and cover page capacity, cursors, valid roots, and indexed query plans. Verification: agent-core sidebar tests (4 passed); org2 native-sidebar tests (5 passed); cargo check and clippy for agent_core/org2; BuildFast packaged-app pagination and restart checks.
ShiboSheng
force-pushed
the
fix/issue-803-orphan-coordinator-pagination
branch
from
September 1, 2026 21:04
ba56cdb to
5ee69b4
Compare
ShiboSheng
marked this pull request as ready for review
September 1, 2026 23:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #803.
The session sidebar paginates each native stream before rendering it. PR #1190 already fixes the standalone SDE stream so rows marked with
org_member_idcannot consume that stream's page capacity unless they are represented as a persisted Agent Org root. The remaining gap was the global pinned-native stream: it accepted every pinned, top-level native row before applying the cursor andLIMIT.Historical coordinator/member rows can retain
org_member_idafter their Agent Org runtime run is gone. Those orphan rows are not valid standalone sessions or valid Agent Org roots, but the pinned query let them displace real pinned SDE, OS, Human, and CLI sessions.The completed Agent Org stack also remained hidden in ordinary release builds because both the frontend bundle and Rust runtime defaulted the rollout gate off. This top-stack commit makes the completed product available by default while preserving an explicit environment opt-out.
The authoritative session source is
agent_sessions. A membership-marked row is a valid root only whenagent_org_runtime_runs.root_session_idpoints to it.Solution
fix/issue-840-startup-compatibility) and keep its standalone-stream fix unchanged.org_member_idremain eligible; membership-marked rows require a matching persisted runtime run.ORGII_AGENT_ORG_REDESIGNto1in ordinary frontend bundles, while preserving explicit0.1.The pagination portion remains a read-path invariant fix. The rollout activation changes only build/runtime defaults; neither change modifies schemas, migrations, writers, RPC/wire formats, frontend filters, or persisted historical data.
Potential risks
org_member_idbut has no persisted runtime run will now be hidden. This is intentional: such a row violates the native-sidebar domain invariant and must not consume page capacity.agent_org_runtime_runs.root_session_id. Regression tests explicitly prove those roots remain visible and annotated.fix/issue-840-startup-compatibility) and must be reviewed and merged as its child in the stack.ORGII_AGENT_ORG_REDESIGN=0to disable it; rollback is either that environment override or reverting the activation commit. Malformed explicit values remain disabled on both frontend and backend.Verification
node --test scripts/dev/webpack-config-light.test.cjs— 6 passed, including default-on, explicit opt-out, and WebDriver force-enable cases.TAURI_CONFIG='{"bundle":{"externalBin":[]}}' cargo +1.98.0 test -p agent_core production_gate_defaults_enabled_and_explicit_values_fail_closed— 1 passed.TAURI_CONFIG='{"bundle":{"externalBin":[]}}' cargo +1.98.0 clippy -p agent_core --all-targets -- -D warnings— passed.rustfmt --edition 2021 --check crates/agent-core/src/core/coordination/agent_org_runs/rollout.rsand Prettier on the changed test file — passed.cargo test --manifest-path src-tauri/Cargo.toml -p agent_core core::session::persistence::sidebar::tests -- --nocapture— 4 passed, 0 failed.cargo test --manifest-path src-tauri/Cargo.toml -p org2 native_sidebar -- --nocapture— 5 passed, 0 failed.rustfmt --edition 2021 --check src-tauri/src/agent_sessions/session_directory/aggregation/native_sidebar.rs src-tauri/crates/agent-core/src/core/session/persistence/crud/record.rs— passed.git diff --check— passed.cargo check --manifest-path src-tauri/Cargo.toml -p agent_core -p org2 --all-targets— passed.cargo clippy --manifest-path src-tauri/Cargo.toml -p agent_core -p org2 --all-targets -- -D warnings— passed. Cargo only reported the existing future-incompatibility notice forblock v0.1.6.cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check— not clean because PR fix(startup): isolate cross-version persistence #1190 already contains unrelated rustfmt differences; both files changed by this PR pass rustfmt independently.EXPLAIN QUERY PLANusedidx_agent_sessions_sidebarandidx_agent_org_runtime_runs_root_session.ORGII_AGENT_ORG_REDESIGN=1 pnpm run tauri:build:fast— passed and producedsrc-tauri/target/dev-build/bundle/macos/ORG2.app. Executable SHA-256:5715ce2ecf55491aa206b501d65f3b146ecc50a26298833b2daee567d89a8dca.PRAGMA quick_check = ok; reopening returned the same bounded first page and Load more state.agent_coreandorg2; no TypeScript files were staged.No screenshot is attached because this changes query membership and page capacity, not visual layout. The rendered macOS sidebar was exercised through Computer Use with explicit row and control assertions.