feat(integrations): Notion live e2e + config-get fix + ntn pages argv fix (T4)#76
Merged
Merged
Conversation
…argv fix (T4) Two bugs surfaced by the live Notion e2e: 1. `agentbox config get integrations.notion.enabled` returned `<unset>` even though `config set` + `loadEffectiveConfig` worked. The CLI's `leafValue` / `rawLeafFromValues` helpers split on the FIRST dot only, so 3-level keys never reached the leaf. Replaced with a single `walkKey` helper that walks every segment (mirrors `readLeaf` in `packages/config/src/load.ts`). New regression test `apps/cli/test/config-get-nested.test.ts` covers the plain, `--json`, `--all`, and unset/default branches; all four fail without the fix. 2. The Notion connector's `buildArgv` produced singular `['page', 'create', ...]` but real `ntn` uses plural `pages` (`api datasources files pages login logout whoami workers`). A live `notion pages create` through the host relay failed with `error: unrecognized subcommand 'page'`. Fixed in `connectors/notion.ts`; existing tests in `integrations/test/` and `relay/test/` updated to assert the new argv. Live read e2e: `notion whoami` and `notion api v1/users/me` round-trip through the in-box shim → host relay → Notion API with no prompt; `notion api -X POST` and `--method PATCH` are refused via `refuseApiNonGet` (exit 65); `printenv | grep -i notion` shows nothing in the agent's env. Closes T4. Nested-box e2e deferred — the in-box ctl daemon forwards to the host relay, so a nested box's write still terminates at the host relay's spawn, not exercising the connector code path differently; tracked in docs/integrations.md.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Closes T4 of the Notion integration backlog (T1 #73, T2 #74, T3 #75 already merged into
add-ticketing-integrations). T4 = live end-to-end verification + fix the bugs the e2e surfaces + close out the docs.Two bugs surfaced and fixed by the e2e
1.
agentbox config getcouldn't read 3-level nested keysagentbox config set --project integrations.notion.enabled truewrote correct YAML, andloadEffectiveConfig(cwd).effective.integrations.notion.enabledreturnedtrue, butagentbox config get integrations.notion.enabledreturned<unset>. TheleafValue/rawLeafFromValueshelpers inapps/cli/src/commands/config.tssplit on the FIRST dot only, so the deepest leaf was never reached.config set(packages/config/src/write.ts:setLeaf) andloadEffectiveConfig(packages/config/src/load.ts:readLeaf) split on ALL dots — asymmetric bug.Fix: single
walkKey(obj, key)helper that walks every segment (mirrorsreadLeaf's shape).Regression test: new
apps/cli/test/config-get-nested.test.tscovers plain,--json,--all, and unset-defaults; all four fail without the fix.2. Connector
buildArgvused singularpage, realntnusespagesA live
notion pages createthrough the host relay (built from T3 code) failed with:Real
ntn's surface (fromntn --help):api datasources files pages login logout whoami workers. The connector'sbuildArgvproduced['page', 'create', ...](singular). Fixed inconnectors/notion.ts; tests inpackages/integrations/test/registry.test.tsandpackages/relay/test/integrations.test.tsupdated to assert the new argv.E2E evidence captured
notion whoami→ bot identity, no prompt (read).notion api v1/users/me→ JSON identity, no prompt (read).notion api -X POSTand--method PATCH→ exit 65 withrefuseApiNonGetmessage (write classified, refused before any host spawn).printenv | grep -i notion→ empty in the agent's process env. The carried~/.config/notion/auth.jsonis for nested-box relay hosts, not the agent.agentbox config get integrations.notion.enabled→ now printstrue (from: project ...)(was<unset>before the fix).agentbox doctor→[ ok ] notion ntn version ... · authed.Live write round-trip — needs the host relay rebuilt with this PR
The host relay was rebuilt with T3 code before T4 started, so the prompted write test hit the bug (which is the evidence the bug exists). Once this PR merges and the host relay rebuilds, the prompted write path will work end-to-end. Confidence: (a) the failure mode matches the bug exactly, (b)
/usr/bin/ntn pages create --helpconfirms the new argv is right, (c) unit tests pin the new argv.Nested-box e2e — deferred
Architecturally, the in-box
agentbox-ctldaemon (port 8788) forwards/rpcto the HOST relay (host.docker.internal:8787), so a nested box'snotion pages createstill terminates at the host relay's spawn — it doesn't exercise the connector code differently from the primary e2e. The carry block inagentbox.yamlis verified (~/.config/notion/auth.jsonpresent in this box). Tracked indocs/integrations.mdunder "Open follow-ups".Docs closeout
docs/notion_backlog.md: T4 marked ✅ done with full evidence; new status-log entry.docs/integrations_backlog.md: new## Statussection marks the Notion path complete (T1–T4); calls out deferred items (comment.add, host-initiated tokens for integrations, nested-box e2e).docs/integrations.md: new## Verification / live e2e resultssection between "Carry-based file-auth" and "Cross-provider parity".Test plan
pnpm typecheckgreen (25/25 packages)pnpm testgreen (494 + 217 + 174 + ... passing across 25 packages)pnpm buildgreenNote
Low Risk
Targeted CLI config lookup fix, Notion argv correction, tests, and documentation; no auth or relay gate logic changes beyond the argv fix for host spawns.
Overview
Closes Notion T4: live read e2e evidence is captured in docs, and two bugs found during e2e are fixed in code.
agentbox config getnow resolves dot-path keys by walking every segment via a newwalkKeyhelper inconfig.ts, so keys likeintegrations.notion.enabledmatchconfig set/loadEffectiveConfiginstead of splitting only on the first dot and showing<unset>.config-get-nested.test.tslocks in plain,--json,--all, and default fallback behavior.The Notion connector’s
page.create/page.updatebuildArgvnow invokesntn pages create|update(plural), matching the real CLI; integration and registry tests assert the updated argv.Internal docs (
integrations.md,notion_backlog.md,integrations_backlog.md) record T4 verification results, mark the Notion path complete, and note deferred nested-box e2e.Reviewed by Cursor Bugbot for commit 6954e09. Configure here.