Skip to content

fix(flows): expose platform_user_id in flows_list_connections schema + self-DM review follow-ups#4941

Merged
graycyrus merged 4 commits into
tinyhumansai:mainfrom
graycyrus:fix/flows-self-dm-schema-followup
Jul 16, 2026
Merged

fix(flows): expose platform_user_id in flows_list_connections schema + self-DM review follow-ups#4941
graycyrus merged 4 commits into
tinyhumansai:mainfrom
graycyrus:fix/flows-self-dm-schema-followup

Conversation

@graycyrus

@graycyrus graycyrus commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the merged self-DM PR #4933 (platform_user_id surfacing). #4933 was merged before its review round landed — this PR carries the 4 valid review findings, one a real contract gap.

Fixes

  • Codex P2 (real gap): flow_connection_fields() in schemas.rs never advertised platform_user_id, so schema-driven clients hitting /schema couldn't see the field the RPC actually returns. Added the field + fixed stale "kind ONLY" wording + updated the locking schema test.
  • CodeRabbit: ListFlowConnectionsTool::description() said "kind ONLY" while documenting platform_user_id/toolkit — reworded to "only non-secret metadata."
  • CodeRabbit: identity-cache load in flows_list_connections was silent — added tracing::debug!(count = …).
  • CodeRabbit: the standing-prompt test only checked keyword presence — added assertions for the actual "pass as channel on SLACK_SEND_MESSAGE" wiring instruction + the null-fallback text.

Testing

  • cargo test --lib openhuman::flows:: → all pass (387 on the source branch); cargo check + cargo fmt --check clean.

Acceptance criteria

  • /schema now advertises platform_user_id (schema-driven clients see it)
  • Tool description no longer self-contradictory
  • Prompt test asserts the real self-DM wiring instruction, not just keywords

Summary by CodeRabbit

  • New Features

    • Connection listings now include an optional, secret-free platform user ID for supported connections.
    • This metadata can support more reliable self-targeted messaging actions.
  • Documentation

    • Connection metadata descriptions now clarify the available fields and confirm that secret information is never returned.
    • Guidance for self-messaging now explains how to use a platform user ID and what to do when it is unavailable.

The public schema advertised by flow_connection_fields() only listed
connection_ref/kind/display/toolkit/scheme, so schema-driven agents/clients
discovering flows_list_connections via /schema still saw the self-DM
identity as unavailable even though the RPC payload now carries it.
Add the field, fix the stale "kind ONLY" description wording, and update
the test that locks the field list.

addresses @chatgpt-codex-connector on src/openhuman/flows/types.rs:312
"returns ids + display labels + kind ONLY" conflicted with the documented
platform_user_id/toolkit/scheme fields the tool actually emits. Replace
"ONLY" with an accurate "only non-secret metadata" framing so the agent
doesn't read the description as excluding fields it should use.

addresses @coderabbitai on src/openhuman/flows/builder_tools.rs:1524
The new identity source was loaded silently, so an empty cache couldn't be
distinguished from a matching failure in logs. Add a namespaced
tracing::debug! with the loaded count (no identity values logged).

addresses @coderabbitai on src/openhuman/flows/ops.rs:2369
The existing checks only asserted the presence of the platform_user_id/DM
me keywords, so a regression could drop the actual "pass it as channel"
instruction or the null-platform_user_id fallback while the looser keyword
checks kept passing. Add focused assertions for both.

addresses @coderabbitai nitpick on
src/openhuman/flows/agents/workflow_builder/builder_prompt.rs:361-378
@graycyrus
graycyrus requested a review from a team July 16, 2026 06:11
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

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: 5cf506e3-4fa0-42b3-9fb0-9bf77dbf4aa1

📥 Commits

Reviewing files that changed from the base of the PR and between 97ade54 and 62a1970.

📒 Files selected for processing (4)
  • src/openhuman/flows/agents/workflow_builder/builder_prompt.rs
  • src/openhuman/flows/builder_tools.rs
  • src/openhuman/flows/ops.rs
  • src/openhuman/flows/schemas.rs

📝 Walkthrough

Walkthrough

The connection listing schema and documentation now expose optional secret-free platform_user_id metadata. Identity-cache loading emits a debug log, and workflow-builder tests enforce self-DM routing and missing-identity fallback guidance.

Changes

Connection Metadata and Guidance

Layer / File(s) Summary
Connection listing metadata contract
src/openhuman/flows/schemas.rs, src/openhuman/flows/builder_tools.rs, src/openhuman/flows/ops.rs
list_connections documents and validates optional platform_user_id metadata, while identity-cache loading emits a debug log.
Self-DM prompt assertions
src/openhuman/flows/agents/workflow_builder/builder_prompt.rs
The standing-prompt test checks verbatim Slack channel routing and the null-identity member-ID fallback wording.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested labels: rust-core, bug

Suggested reviewers: senamakel

Poem

I’m a rabbit with metadata bright,
Routing each self-DM just right.
If the ID’s not in sight,
Ask once, don’t guess the flight—
And log the cache load tonight! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main schema change and the self-DM review follow-ups in this pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

@coderabbitai coderabbitai Bot added bug rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. labels Jul 16, 2026
@graycyrus
graycyrus marked this pull request as draft July 16, 2026 06:21
@graycyrus
graycyrus marked this pull request as ready for review July 16, 2026 06:59
@graycyrus
graycyrus merged commit 6d0b7c2 into tinyhumansai:main Jul 16, 2026
22 of 26 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Team Openhuman Jul 16, 2026
senamakel pushed a commit to M3gA-Mind/openhuman that referenced this pull request Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant