Repository navigation
Manage AI providers from the CLI - #501
Stephen Belanger (Qard) wants to merge 2 commits into
Conversation
|
Latest downloadable build artifacts for this PR commit
Available artifact names
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed1fbbb548
ℹ️ 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 (@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 (@codex) address that feedback".
| #[command(subcommand)] | ||
| command: Command, |
There was a problem hiding this comment.
Default the resource command to listing providers
Running bt ai-providers currently fails because command is required, rather than listing providers as the established resource-command pattern requires. In src/projects/mod.rs, the subcommand is optional and None dispatches to list::run; use the same optional-subcommand dispatch here so the new resource behaves consistently.
AGENTS.md reference: AGENTS.md:L35-L35
Useful? React with 👍 / 👎.
| /// Provider name | ||
| name: String, |
There was a problem hiding this comment.
Provide named alternatives for provider identifiers
The new commands accept their primary identifiers only positionally: creation requires name, while update and delete require id. This prevents named-argument automation such as bt ai-providers create --name test-provider ... or bt ai-providers delete --id <UUID> --force, contrary to the CLI review's required positional-plus-flag pattern. Follow the ViewArgs pattern in src/projects/mod.rs by adding corresponding flag alternatives and resolving the positional value first.
AGENTS.md reference: AGENTS.md:L35-L35
Useful? React with 👍 / 👎.
Confidence Score: 4/5
[High impact] The PR reaches organization and project AI-provider settings and their stored credentials. The PR appears safe to merge, with non-blocking help and test-coverage gaps. Findings
Fix with agent prompt### Issue 1
src/main.rs:180-181
`ai-providers` is missing from the hard-coded `HELP_TEMPLATE`. Adding `AiProviders` to `Commands` does not add it to this template, so users cannot discover the new command through `bt --help`. Add it under “Projects & resources.”
### Issue 2
src/ai_providers/mod.rs:81-82
The only new test checks argument parsing. None checks the requests sent by these commands, including the promise that metadata-only updates omit the secret at both scopes. Add tests that inspect the method, path, and JSON body for organization and project updates, and confirm that absent secrets stay out of both bodies.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds
Qard explicitly deferred SDK pin alignment until the SDK PR lands; the PR description identifies the mismatch as intentional draft work.
|
| /// Manage organization and project AI providers | ||
| AiProviders(CLIArgs<ai_providers::ProviderArgs>), |
There was a problem hiding this comment.
ai-providers is missing from the hard-coded HELP_TEMPLATE. Adding AiProviders to Commands does not add it to this template, so users cannot discover the new command through bt --help. Add it under “Projects & resources.”
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/main.rs
Line: 180-181
Comment:
**Main help hides providers**
`ai-providers` is missing from the hard-coded `HELP_TEMPLATE`. Adding `AiProviders` to `Commands` does not add it to this template, so users cannot discover the new command through `bt --help`. Add it under “Projects & resources.”
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| #[test] | ||
| fn update_requires_a_change_at_parse_time() { |
There was a problem hiding this comment.
The only new test checks argument parsing. None checks the requests sent by these commands, including the promise that metadata-only updates omit the secret at both scopes. Add tests that inspect the method, path, and JSON body for organization and project updates, and confirm that absent secrets stay out of both bodies.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ai_providers/mod.rs
Line: 81-82
Comment:
**Secret retention lacks tests**
The only new test checks argument parsing. None checks the requests sent by these commands, including the promise that metadata-only updates omit the secret at both scopes. Add tests that inspect the method, path, and JSON body for organization and project updates, and confirm that absent secrets stay out of both bodies.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Teams can list, create, update, and delete AI providers at the organization or project level from
bt. Provider secrets can be piped in or entered at a prompt. Updates can keep the current secret.Project provider support is waiting on the regenerated Rust client. The backend schema change #28447 merged, and the public OpenAPI sync is running. Once the SDK update lands, this draft can switch to the generated requests and align the CLI and daemon SDK pins.
Validation on the current draft:
cargo check --locked --testspassed. Live API verification is pending.SDK-522