Skip to content

refactor(team)!: rename organization to team across the CLI#300

Merged
BlackHole1 merged 2 commits into
mainfrom
refactor/rename-org-to-team
Jul 15, 2026
Merged

refactor(team)!: rename organization to team across the CLI#300
BlackHole1 merged 2 commits into
mainfrom
refactor/rename-org-to-team

Conversation

@BlackHole1

Copy link
Copy Markdown
Member

The product renamed the organization concept to team, and the gateway already shipped the wire-side rename ahead of us: relation-control is now the canonical host with org-control retained only as a legacy alias, and the policy layer reads x-oo-team-name. The CLI was the last un-migrated caller, still speaking the old vocabulary end to end.

Rename the concept wholesale rather than layering aliases over it. The oo org command group becomes oo team; --organization and its --org alias collapse into a single --team; the config key identity.organization becomes identity.team. Membership lookups now target relation-control.{endpoint}/v1/me/teams and read a teams response array, and execution requests send x-oo-team-name. The English and Chinese catalogs, the docs, and the bundled skill guidance follow the same rename.

Backwards compatibility is dropped deliberately: the old command, flags, and config key are removed rather than deprecated. A lingering identity.organization in settings.toml is ignored — logged as an unknown key — and connector commands fall back to the personal identity.

The GitHub-organization references in contrib/ci/ are a different concept and are left untouched.

BREAKING CHANGE: oo org is now oo team. --organization / --org is now --team. The identity.organization config key is now identity.team; update settings.toml, since the old key is ignored and the run silently falls back to the personal identity.

The product renamed the organization concept to team, and the gateway
already shipped the wire-side rename ahead of us: `relation-control`
is now the canonical host with `org-control` retained only as a legacy
alias, and the policy layer reads `x-oo-team-name`. The CLI was the
last un-migrated caller, still speaking the old vocabulary end to end.

Rename the concept wholesale rather than layering aliases over it. The
`oo org` command group becomes `oo team`; `--organization` and its
`--org` alias collapse into a single `--team`; the config key
`identity.organization` becomes `identity.team`. Membership lookups now
target `relation-control.{endpoint}/v1/me/teams` and read a `teams`
response array, and execution requests send `x-oo-team-name`. The
English and Chinese catalogs, the docs, and the bundled skill guidance
follow the same rename.

Backwards compatibility is dropped deliberately: the old command,
flags, and config key are removed rather than deprecated. A lingering
`identity.organization` in settings.toml is ignored — logged as an
unknown key — and connector commands fall back to the personal
identity.

The GitHub-organization references in `contrib/ci/` are a different
concept and are left untouched.

BREAKING CHANGE: `oo org` is now `oo team`. `--organization` / `--org`
is now `--team`. The `identity.organization` config key is now
`identity.team`; update settings.toml, since the old key is ignored and
the run silently falls back to the personal identity.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

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: 4e47d611-795f-47cf-b92f-b849b567cb9e

📥 Commits

Reviewing files that changed from the base of the PR and between ace7d33 and 828c61c.

📒 Files selected for processing (5)
  • contrib/skills/shared/oo/references/connector-execution.md
  • docs/commands.md
  • docs/commands.zh-CN.md
  • docs/self-hosted-connector.md
  • docs/self-hosted-connector.zh-CN.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/self-hosted-connector.zh-CN.md
  • contrib/skills/shared/oo/references/connector-execution.md
  • docs/self-hosted-connector.md
  • docs/commands.md
  • docs/commands.zh-CN.md

Summary by CodeRabbit

  • New Features
    • Added team identity management via team list, team current, team use, and team clear.
    • Updated connector commands to support --team (with --personal conflict validation) for selecting identity.
    • Added persistent identity.team configuration for connector default identity.
  • Documentation
    • Updated English and Chinese CLI docs to replace organization-based identity with team-based identity.
    • Clarified that self-hosted connectors do not support team identity; --team is rejected and identity.team defaults are ignored.
  • Breaking Changes
    • Removed organization identity commands and oo org ... usage in favor of oo team ....

Walkthrough

The CLI replaces organization identity with team identity across settings, configuration, connector commands, headers, telemetry, localization, and documentation. New oo team list/current/use/clear commands manage team membership and the default identity.team setting. Connector run, apps, and proxy commands now use --team, enforce team/personal validation, and reject team identity for self-hosted connectors. Team API responses, formatting, persistence, and command behavior are covered by updated tests.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant IdentityResolver
  participant Connector
  CLI->>IdentityResolver: Resolve --team, identity.team, or --personal
  IdentityResolver-->>CLI: Resolved identity
  CLI->>Connector: Send request with x-oo-team-name when applicable
Loading

Possibly related PRs

  • oomol-lab/oo-cli#274 — Earlier organization-based connector identity logic is replaced by the team-based implementation.
  • oomol-lab/oo-cli#277 — Introduced proxy identity handling that this change migrates from organization to team.
  • oomol-lab/oo-cli#297 — Added the organization command group that this change replaces with team commands.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is relevant, but the breaking-change marker makes it not match the required <type>(<scope>): <subject> format. Remove the ! and use a standard conventional-commit title like refactor(team): rename organization to team across the CLI.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly matches the PR's rename from organization to team across commands, config, docs, and guidance.
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
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch refactor/rename-org-to-team

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/application/commands/connector/run.ts (1)

160-195: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Extract the duplicated team-identity resolution flow into a shared helper.

run.ts, apps.ts, and proxy.ts each reimplement the identical sequence: --personal/--team conflict check, teamFlag trim/empty validation, self-hosted rejection, then settings read + resolveConnectorIdentity ternary. identity.ts already centralizes resolveConnectorIdentity/connectorIdentityHeaders, so it's the natural home for a single helper (e.g. resolveCommandConnectorIdentity(input, context, target)) that performs all four steps once and returns { identity, source } or throws. This removes ~25 duplicated lines per command and prevents the three handlers from silently drifting apart on identity validation as new commands are added.

  • src/application/commands/connector/run.ts#L160-L195: replace the conflict check, teamFlag validation, self-hosted rejection, and settings/resolve block with a call to the new shared helper.
  • src/application/commands/connector/apps.ts#L89-L118: replace the identical block with the same shared helper call.
  • src/application/commands/connector/proxy.ts#L141-L167: replace the identical block with the same shared helper call.

As per coding guidelines, "When identical logic appears in 2+ files, extract it to a shared module."

🤖 Prompt for 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.

In `@src/application/commands/connector/run.ts` around lines 160 - 195, Extract
the duplicated connector identity validation and resolution flow into a shared
helper in identity.ts, such as resolveCommandConnectorIdentity, covering
personal/team conflicts, team trimming and empty validation, self-hosted
rejection, settings retrieval, and resolveConnectorIdentity; return the existing
identity/source pair. Replace the duplicated blocks in
src/application/commands/connector/run.ts lines 160-195,
src/application/commands/connector/apps.ts lines 89-118, and
src/application/commands/connector/proxy.ts lines 141-167 with calls to this
helper, preserving existing errors and behavior at each site.

Source: Coding guidelines

src/application/commands/config/index.cli.test.ts (1)

316-344: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add a nested identity.organization case here. This test only covers a top-level unknown key; add identity.organization so the legacy migration path is exercised too.

🤖 Prompt for 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.

In `@src/application/commands/config/index.cli.test.ts` around lines 316 - 344,
Add a nested identity.organization entry to the persisted settings fixture in
the test “ignores unknown persisted settings keys and logs a warning,” then
update the warning assertions to verify that this nested unknown path is
reported alongside updateNotifier, exercising the legacy migration path.
🧹 Nitpick comments (1)
src/application/commands/team/index.cli.test.ts (1)

34-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the recurring CLI test setup into a local factory.

These tests repeatedly create a sandbox and write the same auth fixture. Add a local factory at the bottom of this file and use it across the suite. As per coding guidelines, “In test files, extract repeated setup (mock, stub, or setup objects) into a local factory function at the bottom of the file.”

Also applies to: 79-85, 100-106, 118-123, 139-144, 176-183, 201-207, 220-225, 238-244

🤖 Prompt for 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.

In `@src/application/commands/team/index.cli.test.ts` around lines 34 - 39, The
team CLI tests repeat sandbox creation and auth-fixture setup; extract this into
a local factory at the bottom of the test file. Update each affected test to use
the factory, preserving any test-specific configuration such as setting
identity.team after the shared setup.

Source: Coding guidelines

🤖 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 `@contrib/skills/shared/oo/references/connector-execution.md`:
- Around line 171-172: Update the guidance near the identity.team behavior to
state that omitting both flags uses the configured team when identity.team is
set, while only --personal forces a personal run; retain the default
personal-identity behavior when no team is configured.

In `@docs/commands.md`:
- Around line 217-224: Update the Teams documentation section in
docs/commands.md (lines 217-224) and docs/commands.zh-CN.md (lines 191-196) to
scope the OOMOL/self-hosted restriction only to account-backed team lookup/use
commands, specifically oo team list and oo team use. Clarify that oo team
current and oo team clear are offline/local commands and remain available
without OOMOL access.

In `@docs/self-hosted-connector.md`:
- Around line 180-183: Update the team identity restriction documentation in
docs/self-hosted-connector.md lines 180-183 to state that oo connector apps
--team is rejected with exit code 2, alongside the existing run and proxy
commands. Add equivalent Chinese wording in docs/self-hosted-connector.zh-CN.md
lines 161-163.

---

Outside diff comments:
In `@src/application/commands/config/index.cli.test.ts`:
- Around line 316-344: Add a nested identity.organization entry to the persisted
settings fixture in the test “ignores unknown persisted settings keys and logs a
warning,” then update the warning assertions to verify that this nested unknown
path is reported alongside updateNotifier, exercising the legacy migration path.

In `@src/application/commands/connector/run.ts`:
- Around line 160-195: Extract the duplicated connector identity validation and
resolution flow into a shared helper in identity.ts, such as
resolveCommandConnectorIdentity, covering personal/team conflicts, team trimming
and empty validation, self-hosted rejection, settings retrieval, and
resolveConnectorIdentity; return the existing identity/source pair. Replace the
duplicated blocks in src/application/commands/connector/run.ts lines 160-195,
src/application/commands/connector/apps.ts lines 89-118, and
src/application/commands/connector/proxy.ts lines 141-167 with calls to this
helper, preserving existing errors and behavior at each site.

---

Nitpick comments:
In `@src/application/commands/team/index.cli.test.ts`:
- Around line 34-39: The team CLI tests repeat sandbox creation and auth-fixture
setup; extract this into a local factory at the bottom of the test file. Update
each affected test to use the factory, preserving any test-specific
configuration such as setting identity.team after the shared setup.
🪄 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: 431af796-b67b-4769-888e-b8129c2d5ef8

📥 Commits

Reviewing files that changed from the base of the PR and between 1ca8c13 and ace7d33.

⛔ Files ignored due to path filters (3)
  • src/application/bootstrap/__snapshots__/run-cli.test.ts.snap is excluded by !**/*.snap
  • src/application/commands/config/__snapshots__/index.cli.test.ts.snap is excluded by !**/*.snap
  • src/application/commands/connector/__snapshots__/index.cli.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (32)
  • contrib/skills/shared/oo/references/connector-execution.md
  • docs/commands.md
  • docs/commands.zh-CN.md
  • docs/self-hosted-connector.md
  • docs/self-hosted-connector.zh-CN.md
  • src/application/commands/catalog.ts
  • src/application/commands/config/index.cli.test.ts
  • src/application/commands/config/shared.ts
  • src/application/commands/connector/apps.ts
  • src/application/commands/connector/identity.test.ts
  • src/application/commands/connector/identity.ts
  • src/application/commands/connector/index.cli.test.ts
  • src/application/commands/connector/proxy.ts
  • src/application/commands/connector/run.ts
  • src/application/commands/connector/shared.test.ts
  • src/application/commands/org/clear.ts
  • src/application/commands/org/current.ts
  • src/application/commands/org/index.ts
  • src/application/commands/org/shared.ts
  • src/application/commands/org/use.ts
  • src/application/commands/team/clear.ts
  • src/application/commands/team/current.ts
  • src/application/commands/team/index.cli.test.ts
  • src/application/commands/team/index.ts
  • src/application/commands/team/list.test.ts
  • src/application/commands/team/list.ts
  • src/application/commands/team/shared.test.ts
  • src/application/commands/team/shared.ts
  • src/application/commands/team/use.ts
  • src/application/commands/telemetry-decisions.test.ts
  • src/application/schemas/settings.ts
  • src/i18n/catalog.ts
💤 Files with no reviewable changes (5)
  • src/application/commands/org/shared.ts
  • src/application/commands/org/clear.ts
  • src/application/commands/org/use.ts
  • src/application/commands/org/index.ts
  • src/application/commands/org/current.ts

Comment thread contrib/skills/shared/oo/references/connector-execution.md Outdated
Comment thread docs/commands.md Outdated
Comment thread docs/self-hosted-connector.md Outdated
Comment on lines +180 to +183
- **Team identity is not supported.** `--team` is rejected with exit code `2` on
`oo connector run` and `oo connector proxy`, and any configured `identity.team`
default is ignored. `--personal` is accepted (it is already the effective
behavior).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document the oo connector apps restriction in both self-hosted guides.

  • docs/self-hosted-connector.md#L180-L183: include oo connector apps --team as rejected with exit code 2.
  • docs/self-hosted-connector.zh-CN.md#L161-L163: add the equivalent Chinese wording.
📍 Affects 2 files
  • docs/self-hosted-connector.md#L180-L183 (this comment)
  • docs/self-hosted-connector.zh-CN.md#L161-L163
🤖 Prompt for 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.

In `@docs/self-hosted-connector.md` around lines 180 - 183, Update the team
identity restriction documentation in docs/self-hosted-connector.md lines
180-183 to state that oo connector apps --team is rejected with exit code 2,
alongside the existing run and proxy commands. Add equivalent Chinese wording in
docs/self-hosted-connector.zh-CN.md lines 161-163.

CodeRabbit caught three inaccuracies in the prose the rename touched.
All three predate this PR but are worth fixing while the lines are
already in the diff.

The skill guidance told agents that omitting `--team` and `--personal`
runs under the personal identity. It does not: `resolveConnectorIdentity`
falls back to the `identity.team` config default first, so an agent
following that advice would execute under the wrong identity whenever a
default team is configured. Only `--personal` forces a personal run.

The Teams section claimed the whole command group needs an OOMOL
account. Only `oo team list` and `oo team use` do — they query
membership. `oo team current` and `oo team clear` just read and write
local settings and work with no account at all.

The self-hosted guides listed `--team` as rejected on `oo connector run`
and `oo connector proxy` but omitted `oo connector apps`, which rejects
it the same way.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@BlackHole1 BlackHole1 merged commit cb1d807 into main Jul 15, 2026
6 checks passed
@BlackHole1 BlackHole1 deleted the refactor/rename-org-to-team branch July 15, 2026 09:18
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.

1 participant