Skip to content

Commit e338f6d

Browse files
committed
feat(self-driving): sync only the actionable table for credential sources
Switch the credential connector from data-warehouse-source-setup (which enables every discoverable table) to external-data-sources-create with an explicit single-table schema, matching the Linear connector. Credential inbox sources now sync just their actionable table (tickets/issues) via the stored credential. Depends on the posthog create endpoint accepting a credential_id; degrades to the dormant fallback on older backends.
1 parent c6ee5ae commit e338f6d

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

context/skills/self-driving/references/5-connected-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Emit:
2424

2525
## Tools
2626

27-
Load `wizard_ask` via `ToolSearch select:mcp__wizard-tools__wizard_ask`. Reach `external-data-sources-list` through the PostHog `exec` tool (`info` then `call`); the source-config tools from step 4 are reached the same way. The credential connector (`5c-credentials.md`) additionally uses `data-warehouse-source-connect-link`, `data-warehouse-stored-credentials-list`, and `data-warehouse-source-setup` through the same `exec` tool.
27+
Load `wizard_ask` via `ToolSearch select:mcp__wizard-tools__wizard_ask`. Reach `external-data-sources-list` through the PostHog `exec` tool (`info` then `call`); the source-config tools from step 4 are reached the same way. The credential connector (`5c-credentials.md`) additionally uses `data-warehouse-source-connect-link`, `data-warehouse-stored-credentials-list`, and `external-data-sources-create` through the same `exec` tool.
2828

2929
## Do
3030

context/skills/self-driving/references/5c-credentials.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@ Emit (substitute the tool name):
1414

1515
## Tools
1616

17-
Reach all three through the PostHog `exec` tool (`info` then `call`): `data-warehouse-source-connect-link`, `data-warehouse-stored-credentials-list`, `data-warehouse-source-setup`.
17+
Reach all three through the PostHog `exec` tool (`info` then `call`): `data-warehouse-source-connect-link`, `data-warehouse-stored-credentials-list`, `external-data-sources-create`.
1818

19-
`<Type>` below is the capitalized data-warehouse source type: `Zendesk`, `PgAnalyze`, `Jira` (the same string `external-data-sources-list` reports). The connect page renders the right credential form for that kind on its own.
19+
`<Type>` below is the capitalized data-warehouse source type, and `<table>` is the **one** actionable table its responder reads (sync only that one, like the Linear connector — not every table the source has):
20+
21+
| Tool | `<Type>` | `<table>` |
22+
| --------- | ----------- | ---------- |
23+
| Zendesk | `Zendesk` | `tickets` |
24+
| pganalyze | `PgAnalyze` | `issues` |
25+
| Jira | `Jira` | `issues` |
26+
27+
The connect page renders the right credential form for that kind on its own.
2028

2129
## Do
2230

@@ -43,18 +51,21 @@ Reach all three through the PostHog `exec` tool (`info` then `call`): `data-ware
4351
- **Credential present** → create the source (below).
4452
- **None present** (the user didn't actually store anything, or it expired) → **don't re-ask or wait** — record "picked but not connected" and return to step 5 (the dormant responder + follow-up cover it; the user can finish the connect page later). This run never nudges.
4553

46-
4. **Create the source** with `data-warehouse-source-setup`, passing the stored credential by reference — never inline secrets:
54+
4. **Create the source** with `external-data-sources-create`, passing the stored credential by reference and syncing **only** the one actionable table — never inline secrets, never every table:
4755

4856
```json
4957
{
5058
"source_type": "<Type>",
51-
"payload": { "credential_id": "<credential id>" }
59+
"payload": {
60+
"credential_id": "<credential id>",
61+
"schemas": [{ "name": "<table>", "should_sync": true, "sync_type": "full_refresh" }]
62+
}
5263
}
5364
```
5465

55-
`setup` validates the stored credentials, discovers the tables, and creates the source in one call. It enables **all** discoverable tables (unlike the Linear connector's single `issues` table); that's fine — the responder only reads the actionable one (tickets / issues) and the extra tables are harmless. Note in the report that all tables were enabled so the user can trim them later if they want.
66+
`full_refresh`, not incremental: inbox records get edited and closed after they're created, so an incremental append would miss the updates (the same reason the issues connectors use it). `create` validates the stored credentials, creates the source with just that one table, and consumes the credential.
5667

5768
- Success returns the source `id` → record "connected by this setup (source id …, first sync started)".
58-
- Any failure (invalid or expired credentials, validation error) → don't loop the user back through the page; record "picked but not connected" and return to step 5 (dormant responder + follow-up). A failed connect never dead-ends the run.
69+
- Any failure (invalid or expired credentials, validation error, or a backend old enough that `create` doesn't yet accept `credential_id`) → don't loop the user back through the page; record "picked but not connected" and return to step 5 (dormant responder + follow-up). A failed connect never dead-ends the run.
5970

6071
Return to step 5 (responder enabling and class recording happen there).

0 commit comments

Comments
 (0)