Skip to content

feat(computer): captcha_provider selects TypeSafe or Surplus for the captcha solver - #8733

Merged
senamakel merged 19 commits into
tinyhumansai:mainfrom
senamakel:surplus-jev
Nov 15, 2026
Merged

senamakel merged 19 commits into
tinyhumansai:mainfrom
senamakel:surplus-jev

Conversation

@senamakel

@senamakel senamakel commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

TinyComputer v0.18.0 re-pin

This PR pins TinyComputer v0.18.0 (tag commit 54aea142427d384aa38301c10d24038a1010acca, bus contract 3.3), which adds the Jev provider surplus. vendor/tinycomputer is at that gitlink, the tinycomputer registry record uses the asset digests from the release's checksum.toml, and the registry release test expects v0.18.0 and contract 3.3.

Release: https://github.com/tinyhumansai/tinycomputer/releases/tag/v0.18.0
Related: tinyhumansai/tinycomputer#179, tinyhumansai/tinycomputer#181

What

Adds [computer] captcha_provider, which picks where the captcha solver's image-reading Jev runs:

[computer]
captcha_solver = true
captcha_provider = "surplus"   # "type_safe" (default when absent) | "surplus"
  • type_safe, or the key left out: behaviour is byte-identical to today. The key comes from the typesafe credential or TYPESAFE_API_KEY, and the section sent is {"jev":{"api_key","provider":"type_safe","model"?},"max_attempts"?}.
  • surplus (Surplus Intelligence): the key comes from the surplus credential or SURPLUS_API_KEY, and the section sends "provider":"surplus". captcha_model is sent only when it is set; otherwise the module defaults Surplus to jev-1.14. A TypeSafe key is never sent to Surplus. With no Surplus key there is no captcha section.
  • config.update_computer_settings accepts captcha_provider and normalises it (case, -/_, and typesafe all map to type_safe). Empty restores the default. Any other value is refused with Unsupported captcha provider '<x>'. Use type_safe or surplus.
  • If someone hand-edits an unknown value into the TOML, the solver stays off and a warning is logged.
  • A debug log line you can grep for, [computer] captcha solver provider=<provider>, names the provider. It never includes the key.

The host only owns the config. It talks to TinyComputer through the bus contract alone.

Tests

  • config/schema/computer_tests.rs: default is absent, and the setting round-trips through TOML.
  • config/ops/computer_tests.rs: accepted spellings, empty resets, unknown values refused with the accepted list.
  • config/schemas/controllers_tests.rs: an update_computer_settings RPC persists captcha_provider, and the schema documents it.
  • modules/computer_config_tests.rs: Surplus uses the Surplus key, sends the model only when set, and passes the attempt limit through. An explicit type_safe equals the default. Surplus without a key, or an unknown provider, sends no section.

pnpm rust:layout: check-test-ownership fails on four agent/ test files, and it fails the same way on main. This PR doesn't touch those files.

Docs

docs/gitbooks/en/developing/jev.md

Summary by CodeRabbit

  • New Features
    • CAPTCHA solving can use TypeSafe or Surplus, with TypeSafe selected by default. Choose a provider in computer settings; unsupported values are rejected.
    • Each provider uses its own credentials and default image model. If the selected provider’s credential is unavailable, CAPTCHA solving is omitted rather than switching providers.
  • Updates
    • Updated TinyComputer to version 0.18.0.
    • Privacy information now identifies TypeSafe or Surplus as recipients of CAPTCHA images when CAPTCHA solving is enabled.
  • Documentation
    • Updated browser-control guidance with provider options, credential setup, model defaults, and CAPTCHA attempt limits.

senamakel and others added 11 commits November 15, 2026 05:33
Update the vendored tinycomputer submodule to the latest upstream commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a `captcha_provider` field to the computer config so the captcha solver can run on either TypeSafe or Surplus Intelligence, defaulting to TypeSafe when unset. The settings patch normalises and validates the value, rejecting unknown providers with an error that lists the accepted options.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The captcha solver can now use either TypeSafe or Surplus as its Jev provider, selected via a new `captcha_provider` setting that defaults to TypeSafe when unset. The provider's own API key is resolved for the chosen route, and unknown providers are rejected at config time and skipped with a warning at runtime.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The captcha debug log now formats the provider directly into the message string instead of passing it as a structured field, keeping the log output unchanged while simplifying the call.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The captcha solver section now describes the new `captcha_provider` setting, which chooses between TypeSafe and Surplus Intelligence for image challenges, along with the per-provider default models and the validation that rejects unknown values.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a test that update_computer_settings writes the selected captcha provider to the config file and that the schema exposes the captcha_provider input with its supported values.

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

The update handler now writes a null captcha provider instead of the
submitted value, and the test resolves the schema through the shared
schema definitions. This keeps the stored provider from being overwritten
by settings updates.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The update handler was hardcoding captcha_provider to None, silently discarding any value supplied by the caller. It now passes through update.captcha_provider so the setting is actually saved.

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

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The auto-commit hook recorded the in-progress tinycomputer checkout; the
re-pin to the released v0.18.0 lands separately.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinycomputer submodule to the latest upstream commit.

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

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The update adds TypeSafe and Surplus as CAPTCHA provider options, passes the selected provider through computer settings, and uses its credential when building CAPTCHA configuration. It also updates TinyComputer registry assets, release fixtures, and the vendored subproject reference to version 0.18.0.

Changes: CAPTCHA Provider Selection

Layer / File(s) Summary
Provider setting and update flow
crates/openhuman-core/src/config/schema/computer.rs, crates/openhuman-core/src/config/schema/computer_tests.rs, crates/openhuman-core/src/config/schemas/schema_defs/agent.rs, crates/openhuman-core/src/config/schemas/helpers.rs, crates/openhuman-core/src/config/ops/computer.rs, crates/openhuman-core/src/config/ops/computer_tests.rs, crates/openhuman-core/src/config/schemas/controllers/agent.rs, crates/openhuman-core/src/config/schemas/controllers.rs, crates/openhuman-core/src/config/schemas/controllers_tests.rs
Computer settings now include an optional CAPTCHA provider. Update handling normalizes type_safe, typesafe, and surplus, treats blank input as unset, and rejects other values. Tests cover parsing, serialization, and update handling.
Provider-specific CAPTCHA configuration
crates/openhuman-core/src/modules/computer_config.rs, crates/openhuman-core/src/modules/computer_config_tests.rs, docs/gitbooks/en/developing/jev.md, crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs
CAPTCHA configuration selects TypeSafe or Surplus and uses the corresponding credential key. Missing credentials and unknown providers omit the CAPTCHA section. Documentation describes provider credentials, model defaults, and attempt limits. Privacy destinations identify TypeSafe or Surplus as recipients of CAPTCHA images when the solver is enabled.

TinyComputer Release Update

Layer / File(s) Summary
Registry assets and release fixtures
crates/openhuman-core/src/modules/registry/records_computer.rs, crates/openhuman-core/src/modules/registry_computer_release_tests.rs, vendor/tinycomputer
The registry and test fixtures reference TinyComputer 0.18.0 with updated archive digests. The release test expects bus contract version (3, 3), and the vendored subproject reference changes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ComputerSettings
  participant SettingsPatch
  participant ComputerConfig
  participant JevConfig
  ComputerSettings->>SettingsPatch: provide captcha_provider
  SettingsPatch->>ComputerConfig: normalize and store provider
  ComputerConfig->>JevConfig: select provider and credential key
Loading

Possibly related issues

  • tinyhumansai/openhuman#8094: This PR adds a separate CAPTCHA provider setting for Jev image reading, but does not unify provider configuration across Jev routing and Computer.decision_model.

Suggested labels: rust-core

Suggested reviewers: m3ga-mind, yellowsnnowmann, codeghost21

Merge Risk: Minimal · up to 606ba

This adds a captcha provider choice, defaulting to TypeSafe, with validated settings updates and a disclosure update. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a new captcha_provider setting that selects TypeSafe or Surplus for the captcha solver. The changeset matches this. It adds the config field, the settings patch parsin…
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.
Full details: Title check

Explanation

The title names the main change: a new captcha_provider setting that selects TypeSafe or Surplus for the captcha solver. The changeset matches this. It adds the config field, the settings patch parsing, provider-specific key and model handling in computer_config.rs, and tests. The title is specific and single-sentence, and it follows the conventional commit style used by the repository.

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

A rabbit checks the provider key,
TypeSafe or Surplus, clear as can be.
The CAPTCHA route follows its choice,
With models set by config’s voice.
TinyComputer’s new assets arrive,
At point-oh-eighteen-oh, ready to thrive.

Recent review info

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: 9b21ffaf-92b1-4dc0-b7b0-d4dee3181fda
Commits

Reviewing files that changed from the base of the PR and between 7ff4c32 and 606ba8a.

Files selected for processing: 1

  • crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

senamakel and others added 7 commits November 15, 2026 05:55
Update the vendored tinycomputer submodule to the latest upstream commit.

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

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the pinned tinycomputer module record and vendored submodule from 0.17.0 to 0.18.0, refreshing every platform archive name and checksum to match the new release.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Bump the expected module version and bus contract version to 0.18.0 and (3, 3), and refresh the published asset filenames and checksums for every target so the registry contract test matches the new release.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the locked versions of the tinycomputer workspace crates from 0.17.0 to 0.18.0 to match the new release.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the locked tinycomputer-bus dependency from 0.17.0 to 0.18.0 in the app's Cargo.lock.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel marked this pull request as ready for review November 15, 2026 07:21
Copilot AI balanced review requested due to automatic review settings November 15, 2026 07:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T07:27:09.876528Z 7ff4c32 Draft marked ready
ℹ️ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Despite matching published archive pins, TinyComputer’s missing vendored source/gitlink requires human confirmation that the gitlink and locked host builds use v0.18.0/contract 3.3.

No open issues 🎉

What changed in this PR

Adds configurable TypeSafe or Surplus routing for OpenHuman’s captcha solver while keeping TypeSafe as the default. Provider execution remains in TinyComputer; OpenHuman handles configuration and credential selection.

Changes:

  • Adds captcha_provider to configuration and RPC updates, including normalization, validation, and provider-specific credentials.
  • Updates TinyComputer release pins and lockfiles to v0.18.0, with bus contract 3.3 expectations.
  • Adds configuration and routing tests and documents provider selection and defaults.
File Description
docs/​gitbooks/​en/​developing/​jev.md Documents captcha providers, credentials, and model defaults.
crates/​openhuman-core/​src/​modules/​registry/​records_computer.rs Pins v0.18.0 release assets and checksums.
crates/​openhuman-core/​src/​modules/​registry_computer_release_tests.rs Updates release and contract expectations.
crates/​openhuman-core/​src/​modules/​computer_config.rs Selects captcha provider and matching credentials.
crates/​openhuman-core/​src/​modules/​computer_config_tests.rs Tests provider routing and missing-key behavior.
crates/​openhuman-core/​src/​config/​schemas/​schema_defs/​agent.rs Documents the new RPC parameter.
crates/​openhuman-core/​src/​config/​schemas/​helpers.rs Adds the provider to RPC update parameters.
crates/​openhuman-core/​src/​config/​schemas/​controllers/​agent.rs Forwards provider updates to configuration operations.
crates/​openhuman-core/​src/​config/​schemas/​controllers.rs Exposes the handler to unit tests.
crates/​openhuman-core/​src/​config/​schemas/​controllers_tests.rs Tests provider persistence and schema documentation.
crates/​openhuman-core/​src/​config/​schema/​computer.rs Defines and documents the optional provider setting.
crates/​openhuman-core/​src/​config/​schema/​computer_tests.rs Tests defaults and TOML round-tripping.
crates/​openhuman-core/​src/​config/​ops/​computer.rs Normalizes, validates, and applies provider updates.
crates/​openhuman-core/​src/​config/​ops/​computer_tests.rs Tests accepted spellings, reset, and rejection.
crates/​openhuman-app/​Cargo.lock Updates the desktop bus dependency to v0.18.0.
Cargo.lock Updates workspace TinyComputer packages to v0.18.0.

Review effort: Balanced

@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: 7ff4c3245a

ℹ️ 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".

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 15, 2026
The browser automation capability's privacy destinations now list TypeSafe and Surplus Intelligence as recipients of captcha images, gated on the captcha solver being enabled, so the catalog accurately reflects where data can leave the device.

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

Copy link
Copy Markdown
Member Author

On the 'needs a closer look' note: vendor/tinycomputer is a gitlink at 54aea142427d384aa38301c10d24038a1010acca (v0.18.0), Cargo.lock resolves the tinycomputer crates at 0.18.0, and the registry digests are taken verbatim from the release's checksum.toml.

@coderabbitai coderabbitai Bot added the rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. label Nov 15, 2026
@senamakel
senamakel merged commit f52ec22 into tinyhumansai:main Nov 15, 2026
27 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants