Skip to content

fix(planning): a natively-stored connection no longer satisfies a prerequisite (#396) - #508

Merged
senamakel merged 2 commits into
tinyhumansai:mainfrom
oxoxDev:fix/396-connection-prereq
Aug 8, 2026
Merged

fix(planning): a natively-stored connection no longer satisfies a prerequisite (#396)#508
senamakel merged 2 commits into
tinyhumansai:mainfrom
oxoxDev:fix/396-connection-prereq

Conversation

@oxoxDev

@oxoxDev oxoxDev commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #396.

A card's connection prerequisite was satisfied by any row with connected: true,
regardless of which namespace stored it. The oauth/{provider} catalog is the
documented self-hosted hatch — no agent tool consumes those tokens — so a card
whose prerequisite was met that way was cleared to run against a capability that
does not exist. Its sibling verify_composio already required via to include
composio; this brings verify_connection in line.

Most of #396 landed in #402 (console advisory, manifest comment, hosted-tier
credentialSource gating, state reconciliation). This is the remaining consumer
that still treated an inert credential as capability.

API Or Behavior Changes

Planning behavior only; no wire or API change.

A connection prerequisite backed only by a native token now reports Missing
instead of Satisfied. The message acknowledges the stored connection rather than
claiming the provider is unconnected, and names the route that does work:

{name} is connected in this host's catalog, but no agent tool uses that
credential — agents reach {name} through Composio, so connect it there from
the Connections tab

Composio-backed and mixed-namespace rows are unchanged (Satisfied). unverified
rows are unchanged (Unknown) — an inventory outage still never reads as Missing.

Self-hosted operators who natively connected a provider will see planning report the
prerequisite as missing. That is the intended correction: the credential buys no
agent capability today. If #319 wires native tokens to tools, this arm is the one to
revisit, and a comment in the code says so.

Tests

Four new unit tests in src/harness/planning/test.rs, plus one stale fixture
assertion corrected (it asserted Satisfied for a native-only provider).

Every negative control was executed — the fix was broken, the suite run, the failure
observed, then restored:

Control applied Result
Drop the via guard native-only test failed (32 passed / 1 failed)
Composio arm always-Missing 3 tests failed (30 passed / 3 failed)
Require exactly ["composio"] both-namespaces test failed (32 passed / 1 failed)
Delete the unverified arm 2 tests failed (31 passed / 2 failed)

Each control failed exactly the test written to catch it and nothing unrelated.

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo clippy --locked --no-deps --features openhuman,tinycortex --all-targets -- -D warnings
  • cargo test --features openhuman,tinycortex --lib harness::planning::test:: — 33 passed, 0 failed

cargo build --all-targets: N/A — covered by the two clippy lanes above, which build
all targets in both feature configurations.

Documentation

No user-facing docs affected. The prerequisite-kind doc table in planning.rs is
updated to record that connection and composio differ in wording only, not in
what they require.

Summary by CodeRabbit

  • Bug Fixes
    • Improved connection prerequisite checks to distinguish supported connections from native-only credentials.
    • Native-only and empty-namespace connections are now correctly reported as unavailable.
    • Composio-backed connections continue to be recognized as available.
    • Provider matching now handles capitalization differences consistently.
    • Unverified connection records are reported as unknown instead of incorrectly marked available.

…requisite (tinyhumansai#396)

verify_connection stamped satisfied on any row with connected: true,
whatever its via said. A provider connected through the Connections tab
alone is stored under the host's own oauth/{provider} namespace, which
nothing under src/harness/ ever reads — no agent tool resolves a
credential from it. So a card whose prerequisite was "needs a
connection to X" passed the check, dispatched, and failed at the tool
call with no explanation, having been told the capability was there.

The arm now requires composio in via, matching verify_composio. A
native-only row reads missing with a note that acknowledges the stored
credential rather than telling the operator to connect it again — that
is not the action that helps them. unverified still outranks both and
reads unknown, so an inventory outage cannot turn into a wall of
missing.

Tests cover native-only, composio-backed, both namespaces at once, and
unverified across every via shape. Each was checked against its negative
control: reverting the via guard, forcing the composio arm missing,
demanding an exact [composio] match, and dropping the unverified arm
each fail the matching test and no other.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Aug 6, 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: fe9e76bf-7d5d-4cd5-92d9-a07a0b8269e7

📥 Commits

Reviewing files that changed from the base of the PR and between 88cfeb5 and 34fec45.

📒 Files selected for processing (2)
  • src/harness/planning.rs
  • src/harness/planning/test.rs

📝 Walkthrough

Walkthrough

Connection prerequisite verification now requires a Composio-backed connection path. Native-only and namespace-free connections remain missing, while unverified inventory rows remain unknown. Tests cover case-insensitive lookup and mixed namespace ordering.

Changes

Connection verification

Layer / File(s) Summary
Require an agent-usable connection path
src/harness/planning.rs
verify_connection satisfies providers only when their via list includes Composio. Native-only connections are marked missing with operator guidance. The prerequisite documentation describes this rule.
Expand connection verification coverage
src/harness/planning/test.rs
Tests cover case-insensitive provider lookup, native-only and namespace-free connections, Composio-backed connections, mixed namespace ordering, and unverified rows.

Estimated code review effort: 2 (Simple) | ~15 minutes

Poem

I’m a rabbit with a tidy plan,
Composio paths now help agents span.
Native-only rows stay marked apart,
Unknown rows keep their honest chart.
Tests hop through every namespace start.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR fixes planning behavior but does not address the issue’s required connection-surface gating or misleading manifest comment. Also gate or remove the unusable Connect flow and correct the manifest comment claiming runtime OAuth injection.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary planning change: native-only connections no longer satisfy prerequisites.
Out of Scope Changes check ✅ Passed The code and test changes are limited to connection prerequisite planning behavior and directly support the stated objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@senamakel senamakel self-assigned this Aug 8, 2026
@senamakel
senamakel merged commit c19db51 into tinyhumansai:main Aug 8, 2026
6 checks passed
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.

connections: the Connect button stores a credential that no agent can ever use

2 participants