Repository navigation
Add ed-onde-account, an Onde account client - #21
Conversation
There was a problem hiding this comment.
Adds the ed-onde-account crate, a reqwest client for ondeinference.com's account API: sign_in, me, apps, create_app, activate and ensure_key, with typed errors, Debug-redacted AccessToken/ApiKey, and no Onde secrets in the host. Workspace membership, dependency entry, and README table row are updated, and an axum mock covers the client's flows. Code looks solid; the one thing worth a look is the ensure_key idempotency guarantee under concurrency.
Automated review by siGit Code Review · commit 99a95a6 · see the review dashboard
paydii
left a comment
There was a problem hiding this comment.
Change product direction, let's postpone this
There was a problem hiding this comment.
This change introduces the new ed-onde-account crate, a client for the ondeinference.com API that allows agents to sign in users, manage their Onde apps, and obtain Onde Cloud API keys without embedding Onde secrets. The implementation provides typed error handling, redacts sensitive values in debug output, and includes a robust, idempotent ensure_key method that avoids creating duplicate apps even under concurrent calls. The crate is tested with an in-process Axum mock server, and the workspace and documentation are updated to include it. The ed-acp crate is also updated to support on-device inference with onde via a new local feature, including CLI integration and model selection logic. The previous warning about non-atomic app creation in ensure_key is now addressed: the implementation converges on a single app even if concurrent creates occur, and does not violate the "never creates a second app" guarantee, though extra apps may remain unused. No critical or new correctness issues are present in the diff.
Automated review by siGit Code Review · commit cf19b7d · see the review dashboard
|
Let's go with this. |
keypair34
left a comment
There was a problem hiding this comment.
Remove the local inference changes from this PR.
We could merge #20 first and test it on the smbCloud Mail app that only has on-device inference. |
Signs a user in through the ondeinference.com API, finds or creates their app, activates it and returns the Onde Cloud key. ensure_key reuses an app by name, so calling it twice never makes a second one. The crate holds no Onde secrets: the API adds the smbCloud credentials on the server. Covered by tests against an in-process mock of the API. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.6.6 <noreply@sigit.si>
After creating an app, ensure_key lists again and picks the oldest active-or-provisioning app with that name, so two concurrent first calls return the same key. The doc comment now says what holds: the extra app can still exist, since the client has no delete call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.6.3 <noreply@sigit.si>
cf19b7d to
ba341cf
Compare
|
@keypair34 Done — the local-inference changes are no longer part of this PR. They were already merged into I rebased No New head is |
There was a problem hiding this comment.
This change introduces the new ed-onde-account crate, a client for the ondeinference.com API that enables agents to sign in users, manage their Onde apps, and retrieve Onde Cloud API keys without embedding Onde secrets. The crate is added to the workspace and documented in the root README. The implementation includes typed error handling, redacted debug output for sensitive types, and an idempotent ensure_key method that avoids duplicate app creation even under concurrent calls. The test suite uses an axum mock server to cover all major flows and edge cases, including races and error handling. Previous review findings about atomicity and races in ensure_key were addressed by re-listing apps after creation and updating the documentation and tests accordingly. No new unresolved issues from earlier reviews remain.
Automated review by siGit Code Review · commit ba341cf · see the review dashboard
A small reqwest client for the ondeinference.com API, so MailX, Siti and ACP agents can sign a user in and get an Onde Cloud key without each reimplementing it. It holds no Onde secrets: onde-web adds the smbCloud credentials on the server.
sign_in,me,apps,create_app,activateandensure_key.ensure_keyreuses the user's app by name, activates it if it is still provisioning, and returnsapp_id:app_secret. Errors are typed:Unauthorized(token expired),Forbidden,InvalidCredentials,SuspendedandHttp.AccessTokenandApiKeyare redacted inDebug.Stacked on #20 and meant to ship with it as 1.3.0, so the version here is still the workspace's 1.2.1. The release workflow takes its publish list from the workspace members, so it needed no change.
Tested:
cargo test -p ed-onde-account(8 tests against an axum mock of the API, plus the doctest), clippy with-D warnings, and fmt. I have not run it against the live site yet; that needs a test Onde account.