Skip to content

feat(connector): accept multiple <service>.<action> ids in schema command#290

Merged
BlackHole1 merged 1 commit into
mainfrom
feat/connector-schema-action-ids
Jul 2, 2026
Merged

feat(connector): accept multiple <service>.<action> ids in schema command#290
BlackHole1 merged 1 commit into
mainfrom
feat/connector-schema-action-ids

Conversation

@BlackHole1

Copy link
Copy Markdown
Member

oo connector schema used to take exactly one bare service name plus a required --action option, so inspecting more than one action contract — an async submit/result pair, or a read step feeding a write step — meant running the command once per action. This changes the command to accept one or more <service>.<action> qualified ids directly as positional arguments: a single id keeps the existing JSON object output, and two or more widen it to a JSON array in request order.

The old --action form is kept for backwards compatibility but is now restricted to exactly one bare, undotted service name; mixing it with the qualified form is rejected before any metadata request goes out. Telemetry for connector.schema gains action_count_bucket and qualified alongside the existing refresh property, without recording service or action identity.

Bundled oo / oo-create-skill skill references and docs/commands*.md are updated to the <service>.<action> syntax, including guidance to batch lifecycle-style workflows (e.g. submit + result) into one schema call instead of two.

…mand

Previously `oo connector schema` took exactly one bare service name
plus a required `--action` option, so inspecting more than one action
contract (e.g. an async submit/result pair, or a read step feeding a
write step) meant one command per action.

`connectorSchemaCommand` now accepts one or more `<service>.<action>`
qualified ids directly as variadic positional arguments. A single id
keeps the historical JSON object shape; two or more widen the output
to a JSON array in request order. The legacy `--action` form is kept
for backwards compatibility but is now restricted to exactly one bare,
undotted service name, and mixing it with the qualified form is
rejected before any metadata request is issued.

Telemetry for `connector.schema` gains `action_count_bucket` and
`qualified` alongside the existing `refresh` property, still without
recording service or action identity.

Bundled `oo`/`oo-create-skill` skill references and `docs/commands*.md`
are updated to the `<service>.<action>` syntax and document the batch
form for lifecycle-style workflows.

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

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Connector schema lookup now supports one or more qualified action IDs in a single command.
    • Results now return a single object for one action or an ordered array for multiple actions.
  • Bug Fixes

    • Improved validation for malformed action IDs and invalid legacy argument combinations.
    • Updated schema output to hide internal fields from user-facing results.
  • Documentation

    • Refreshed command references and skill docs to use the new <service>.<action> format.
    • Clarified output behavior, legacy compatibility, and refresh behavior.

Walkthrough

This PR changes the oo connector schema CLI command to accept one or more qualified <service>.<action> action ids as positional arguments, replacing the previous serviceName + --action form while retaining legacy compatibility for a single bare service with --action. Output is a single JSON object for one action or a JSON array for multiple actions. New validation errors, telemetry properties (action_count_bucket, qualified), i18n strings, tests, and documentation updates across English/Chinese docs and skill reference files accompany the change.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI as connectorSchemaCommand
  participant Parser as ActionId Parser
  participant Loader as loadConnectorActionSchema
  participant Telemetry

  User->>CLI: oo connector schema <actionId...>
  CLI->>Parser: parse qualified or legacy action ids
  Parser-->>CLI: resolved targets or CliUserError
  CLI->>Telemetry: record action_count_bucket, qualified, refresh
  loop for each target
    CLI->>Loader: fetch schema for service/action
    Loader-->>CLI: schema result
  end
  CLI-->>User: JSON object (1 target) or JSON array (multiple)
Loading

Possibly related PRs

  • oomol-lab/oo-cli#180: Also modifies src/application/commands/connector/schema.ts, changing the loaded schema output for async lifecycle actions in the same handler.
  • oomol-lab/oo-cli#186: Adds a connector schema refresh subcommand wired into the same connector/schema.ts module modified here.
  • oomol-lab/oo-cli#251: Updates the same contrib/skills/shared/oo-create-skill/SKILL.md guidance around oo connector schema usage.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required type(scope): subject format and accurately describes the connector schema update.
Description check ✅ Passed The description is clearly related to the schema command, telemetry, compatibility, and documentation updates in this PR.
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 feat/connector-schema-action-ids

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.

🧹 Nitpick comments (2)
src/application/commands/connector/schema.ts (1)

84-99: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Load multiple action schemas concurrently.

Line 87 serializes independent schema loads, so batched connector schema a.b c.d ... latency grows with the sum of all requests. Promise.all() preserves the input order expected by the output array.

As per coding guidelines, "Use Promise.all() for independent async operations instead of sequential await." <coding_guidelines>

Proposed refactor
-        const account = await requireCurrentAccount(context);
-        const outputs: ConnectorActionSchemaOutput[] = [];
-
-        for (const target of targets) {
-            const actionSchema = await loadConnectorActionSchema(
-                {
-                    account,
-                    actionName: target.actionName,
-                    refresh: input.refresh,
-                    serviceName: target.serviceName,
-                },
-                context,
-            );
-
-            outputs.push(createConnectorActionSchemaOutput(actionSchema));
-        }
+        const account = await requireCurrentAccount(context);
+        const outputs: ConnectorActionSchemaOutput[] = await Promise.all(
+            targets.map(async target => {
+                const actionSchema = await loadConnectorActionSchema(
+                    {
+                        account,
+                        actionName: target.actionName,
+                        refresh: input.refresh,
+                        serviceName: target.serviceName,
+                    },
+                    context,
+                );
+
+                return createConnectorActionSchemaOutput(actionSchema);
+            }),
+        );
🤖 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/schema.ts` around lines 84 - 99, The loop
in the connector schema command is awaiting each load sequentially, so
independent schema fetches are serialized instead of running in parallel. Update
the logic around requireCurrentAccount, loadConnectorActionSchema, and
createConnectorActionSchemaOutput to start all schema loads together with
Promise.all, then build the outputs array from the resolved results in the same
input order.

Source: Coding guidelines

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

3694-3701: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Strengthen telemetry assertions to guarantee absence of raw identity fields.

toMatchObject only verifies the listed keys; it won't fail if service, action, or a raw actionId also leaked into telemetryPayload.properties. Given this PR's explicit goal of "avoiding recording service or action identity," a stricter assertion (e.g., asserting the exact property set, or expect(telemetryPayload.properties).not.toHaveProperty("service")) would materially strengthen the regression guard.

As per path instructions, "When adding command-specific telemetry properties, add or update tests that assert the expected safe property shape and absence of raw/private values."

♻️ Example stronger assertion
             expect(telemetryPayload).toMatchObject({
                 properties: {
                     action_count_bucket: "1-5",
                     command_full: "connector.schema",
                     qualified: true,
                     refresh: false,
                 },
             });
+            expect(telemetryPayload.properties).not.toHaveProperty("service");
+            expect(telemetryPayload.properties).not.toHaveProperty("action");

Also applies to: 3804-3811, 3950-3957

🤖 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/index.cli.test.ts` around lines 3694 -
3701, Strengthen the telemetry tests around connector command payloads so they
verify the safe property shape, not just a subset of keys. In the affected
assertions in connector CLI tests, replace or supplement the current
`expect(telemetryPayload).toMatchObject(...)` checks with assertions on
`telemetryPayload.properties` that guarantee no raw identity fields leak,
especially `service`, `action`, and any raw `actionId`. Use the existing
`telemetryPayload`/`properties` assertions in the connector command test cases
to confirm both the expected fields and the absence of private values.

Source: Path instructions

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

Nitpick comments:
In `@src/application/commands/connector/index.cli.test.ts`:
- Around line 3694-3701: Strengthen the telemetry tests around connector command
payloads so they verify the safe property shape, not just a subset of keys. In
the affected assertions in connector CLI tests, replace or supplement the
current `expect(telemetryPayload).toMatchObject(...)` checks with assertions on
`telemetryPayload.properties` that guarantee no raw identity fields leak,
especially `service`, `action`, and any raw `actionId`. Use the existing
`telemetryPayload`/`properties` assertions in the connector command test cases
to confirm both the expected fields and the absence of private values.

In `@src/application/commands/connector/schema.ts`:
- Around line 84-99: The loop in the connector schema command is awaiting each
load sequentially, so independent schema fetches are serialized instead of
running in parallel. Update the logic around requireCurrentAccount,
loadConnectorActionSchema, and createConnectorActionSchemaOutput to start all
schema loads together with Promise.all, then build the outputs array from the
resolved results in the same input order.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d3b0154c-037c-4aa3-8e59-43c4ecb0b29f

📥 Commits

Reviewing files that changed from the base of the PR and between f872ecc and e97d00d.

⛔ Files ignored due to path filters (1)
  • src/application/commands/connector/__snapshots__/index.cli.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (9)
  • contrib/skills/shared/oo-create-skill/SKILL.md
  • contrib/skills/shared/oo/references/connector-execution.md
  • contrib/skills/shared/oo/references/search-and-selection.md
  • docs/commands.md
  • docs/commands.zh-CN.md
  • src/application/commands/connector/index.cli.test.ts
  • src/application/commands/connector/schema.ts
  • src/application/commands/telemetry-decisions.test.ts
  • src/i18n/catalog.ts

@BlackHole1 BlackHole1 merged commit 69aec76 into main Jul 2, 2026
6 checks passed
@BlackHole1 BlackHole1 deleted the feat/connector-schema-action-ids branch July 2, 2026 07:33
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