Skip to content

fix(auth): scope provider credentials and relocate OAuth ownership - #8373

Merged
senamakel merged 4 commits into
epic/8369-security-migrationfrom
issue/636-auth-oauth-ownership
Oct 24, 2026
Merged

senamakel merged 4 commits into
epic/8369-security-migrationfrom
issue/636-auth-oauth-ownership

Conversation

@senamakel

@senamakel senamakel commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Fix the five credential regressions in #636. Session expiry events now carry the opaque fingerprint of the credential used by the failed request, so stale 401s cannot invalidate a replacement session. Failed credential-scope rebinding rolls back the active-user marker and profile; TinyHumans OAuth refresh runs safely from current-thread runtimes and serializes token rotation; disconnect errors preserve profile consistency.

Move OAuth obtain, refresh, import, pending-state handling, and controller wiring into openhuman-tinyhumans behind the core ProviderCredentialSource port and embed host facade. Existing RPC method names remain unchanged. The TinyAgents gitlink update supplies request-time credential fingerprints through TinyInference. The TinyVoice gitlink and Cargo.lock changes are required for this dependency update: base TinyVoice 0.4 requires TinyAgents 2.x, while the compatible canonical TinyVoice main commit 26c72d599ae516c43ac77c883031b5173ec687e4 requires TinyAgents 3.x and includes TinyInference's sha2 dependency.

Verification

Focused regression tests pass for stale session expiry, credential-scope rollback, concurrent refresh metadata rotation, disconnect with pending-state failure, current-thread OAuth refresh, request-time fingerprint propagation, and the RPC expiry bridge. The TinyHumans provider_oauth suite passes (9 tests). Earlier gates on the implementation branch also passed core/provider OAuth tests, crate-chain/layout checks, app/core checks, and the auth E2E test. The full Rust layout gate still reports 14 storage-schema naming violations in locally aligned TinyChannels source. The hosted Markdown check reports two pre-existing broken links in agent-harness.md to files removed by #8319; those same links are present on both main and the epic base.

Closes senamakel#636
Part of #8369

senamakel and others added 3 commits October 24, 2026 11:48
Session expiry events now carry the credential fingerprint captured before
dispatch, so a backend 401 that arrives after a credential replacement can no
longer clear the newly stored session. The publisher suppresses both the bus
event and the RPC auth-expired marker when the fingerprint no longer matches
the current credential.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinyagents submodule to the latest upstream commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add sha2 to the tinyinference dependency set and pin tinyjuice-module back to 0.11.3, while advancing the vendored tinyvoice submodule to its new revision.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper

tinysweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

⏳ Reviewing a287e38b58e4 now. The last completed report, when available, remains below until this pass finishes.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b3747603-619e-4d77-b210-531a7785be46

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T12:18:51.448141Z a287e38 New commits
🔒 Security Review ✅ Completed 2026-10-24T12:20:32.225228Z a287e38 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c76952e60

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/openhuman-tinyhumans/src/install.rs
Comment thread crates/openhuman-rpc/src/server/socketio.rs
Co-authored-by: Medulla <medulla@tinyhumans.ai>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a287e38b58

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +119 to +122
result = Err(
"Backend request failed; credential provenance could not be verified"
.to_string(),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Migrate hosted clients before suppressing their expiry signals

When a still-locally-valid session is revoked server-side, hosted RPCs such as billing balance and current-plan requests now lose their reauthentication flow. hosted/client.rs::map_error still only returns a SESSION_EXPIRED: string, and neither HostedClient nor BackendClient publishes a fingerprinted expiry event. Because request_credential_fingerprint is always None here, dispatch replaces that string with this generic error without publishing anything, leaving the rejected credential installed and preventing the renderer's auth classifier from requesting sign-in. Move expiry publication into those request-owning clients before disabling their existing dispatcher-based recovery.

Useful? React with 👍 / 👎.

@senamakel
senamakel merged commit 4469cda into epic/8369-security-migration Oct 24, 2026
5 of 6 checks passed
@senamakel
senamakel deleted the issue/636-auth-oauth-ownership branch October 24, 2026 12:20
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