Expose selected Notion workspace ID in structured usage/dashboard identity
Request
Please expose the actual selected Notion workspace ID in CodexBar's supported structured output.
Today the Notion fetch already obtains workspace records, selects a concrete workspace, and uses that workspace's ID as spaceId for the quota/rate-limit request. However, that selected workspace ID is not carried through the supported identity/dashboard export.
Why this matters
Consumers that persist usage snapshots need a stable opaque identity to avoid mixing data across different Notion workspaces.
Current supported output is insufficient for strict workspace isolation:
- user/account ID is available in the Notion usage identity;
- selected workspace ID is not;
- workspace name/email/plan are presentation fields, not stable identity keys;
- the configured preferred workspace ID is not equivalent to the workspace actually selected, because selection may fall back.
Suggested contract
An additive, backward-compatible field carrying the workspace ID actually used by the same quota fetch.
Ideally the supported structured output would expose both:
- authoritative user/account ID;
- authoritative selected workspace ID.
The field should be opaque provider identity metadata, not presentation text.
Important behavior
If a configured preferred workspace is unavailable and CodexBar falls back to another workspace, the exported workspace identity should match the workspace actually queried.
No cookies, auth tokens, or other sensitive browser/session state need to be exposed.
This request is only for a stable supported identity field in structured output.
Codex review: this still needs some work. Reviewed October 5, 2026, 6:36 AM ET / 10:36 UTC.
Summary The requested workspace identity is absent from current main and remains a distinct, useful enhancement. Keep open for approval of the shared export contract and its privacy behavior; repository policy also disables automatic cleanup closes.
Reproducibility: not applicable. as a feature request; source inspection directly confirms that the selected workspace ID is omitted. No live provider probes or artifact-producing tests were run.
Maintainer decision needed
| Question | Recommendation |
|---|---|
| Should supported usage and dashboard identity gain an optional selected workspace ID, and should dashboard full mode expose both account and workspace IDs while redacted and none modes omit them? | Approve additive identifiers with privacy limits: Expose the queried workspace ID in usage identity and both opaque identifiers in full dashboard mode, omitting the new dashboard identifiers in redacted and none modes. |
Why: This extends shared plugin and dashboard contracts; VISION.md reserves new features and privacy behavior for sign-off.
Next step Approve the shared export and privacy contract before implementation; validate fallback selection, both plugin engines, identity scoping, and JSON compatibility once approved.
Review details
Best possible solution:
Carry an optional selected-workspace identifier through the shared identity pipeline, preserving accountID semantics and exporting only the ID used by that quota request under an approved privacy contract.
Do we have a high-confidence way to reproduce the issue?
Not applicable as a feature request; source inspection directly confirms that the selected workspace ID is omitted. No live provider probes or artifact-producing tests were run.
Is this the best way to solve the issue?
Yes, an additive field sourced from the selected workspace is the narrowest reliable approach; copying the configured preference would misidentify fallback requests. Dashboard privacy behavior needs approval first.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
- The naming and privacy-mode treatment of new opaque account/workspace fields are not yet approved.
Codex review notes: model internal, reasoning medium; reviewed against c967d0781736.
Label changes
Label changes:
No label changes.
Label justifications:
P3: This adds useful structured identity metadata without demonstrating a broken existing export contract or urgent user workflow failure.
Evidence reviewed
What I checked:
- Selected workspace is known but omitted: Selection falls back when the preferred workspace is unavailable. The allowance request uses workspace.id, while the returned identity contains userID, email, workspace name, and tier without the selected workspace ID. (
Sources/CodexBarCore/Resources/Plugins/notion.ts:128, c967d0781736) - Shared identity boundary: The plugin mapper accepts accountID but has no workspace identity field. ProviderIdentitySnapshot likewise has no serialized workspace field, so adding one only to the Notion script would not reach supported exports. (
Sources/CodexBarCore/Plugins/ProviderPluginSnapshotMapper.swift:564, c967d0781736) - Dashboard has a separate identity contract: Dashboard identity currently exports email and plan only, not even the usage identity's accountID. The builder suppresses identity in none mode and redacts email in redacted mode; opaque identifier handling therefore needs an explicit contract. (
Sources/CodexBarCLI/DashboardSnapshotBuilder.swift:272, c967d0781736) - Existing fallback regression seam: The bundled plugin test covers empty, normalized, and unknown preferred workspace settings, verifies the queried spaceId, and checks exported user identity. This provides a focused seam for testing that a future workspace field matches the same request across both plugin engines. (
TestsPlugin/NotionPluginTests.swift:14, c967d0781736) - Release contract still lacks workspace identity: ProviderIdentitySnapshot in v0.72.0 also contains accountID but no workspace ID. This request is not demonstrably implemented in either the inspected release identity model or current main. (
Sources/CodexBarCore/ProviderIdentitySnapshot.swift:8, cfee869f3181) - Original provider context: GitHub verifies https://github.com/steipete/CodexBar/pull/2552 as merged, authored by n0ah37 and merged by steipete. Its documented behavior explicitly falls back from an unavailable preferred workspace; it does not promise a selected-workspace export field. (8393fc89bd01)
Likely related people:
- steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
- n0ah37: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
How this review workflow works
- ClawSweeper keeps one durable marker-backed review comment per issue or PR.
- Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
- A fresh review can be triggered by eligible
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch. - PR/issue authors and users with repository write access can comment
@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto request a fresh review only. - Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
- Maintainer-only repair and merge flows require explicit commands such as
@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review. - Maintainers can comment
@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.
Thanks @fakepooh. The selected Notion workspace is a provider-internal selection; exposing its ID in the structured identity would leak a workspace identifier into shared snapshots, which we avoid. Closing.