Skip to content

Fix/provider onboarding flow#236

Merged
mattprintz merged 5 commits into
devfrom
fix/provider-onboarding-flow
Jul 1, 2026
Merged

Fix/provider onboarding flow#236
mattprintz merged 5 commits into
devfrom
fix/provider-onboarding-flow

Conversation

@brandomr

@brandomr brandomr commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the brand-new-user onboarding flow: configure a provider → enter an API key → use the agent. Four independent commits, each one fix:

  1. config: don't let one broken model module break the provider config UI. get_providers() imported every archytas model module; a single failing import (e.g. an upstream dependency mismatch) bubbled up through the config-schema builder and blanked the entire provider-configuration dialog (no API-key field at all). Failing modules are now skipped with a warning, discovery is cached so broken imports aren't re-attempted/re-logged each call, and ConfigController.map_type no longer crashes on non-class type origins (e.g. typing.Literal[...]) or swallows errors silently.

  2. ui: provider-config form no longer overlaps the dialog buttons. The form was styled via a dead id (#config-panel-provider, left with a debug background-color: blue), so it was never placed in its grid cell and its fields overflowed onto the Reset/Cancel/Save row. Pointed the rule at the real element and let it scroll within the cell.

  3. ui: re-run the originating query after configuring credentials. The query cell only tagged msg.cell for the "Request interrupted" case, so on anllm_auth_failure the model-config dialog had no cell to re-run — the user's prompt was silently dropped and had to be re-typed. Now the originating cell is tagged and re-runs once a provider is configured.

  4. kernel: sync chat-history model on live model change. set_agent_model swapped the agent's model but not the chat history's, leaving the chat-history panel (which reads model metadata and token budgets from the chat history) stuck on the keyless default. Routes the change through agent.set_model().

Dependency

We call Agent.set_model(), and the "key takes effect immediately" behavior relies on the env-precedence fix — both from jataware/archytas#83. Merge + release that first, then bump the archytas>= pin in this repo to that release.

Tests

  • tests/test_get_providers_resilience.py — provider discovery tolerates failing imports and returns a fresh (non-shared) mapping.

Manual verification

Full blank-slate run (no config file): first message → provider-config modal (no overflow) → select provider, paste key → Save → key takes immediately → original prompt auto-runs → chat-history panel populates. Verified end-to-end for openai; non-openai providers were verified to bind the configured key directly.

@brandomr
brandomr force-pushed the fix/provider-onboarding-flow branch from 86af42f to 18e869c Compare June 30, 2026 18:59
@mattprintz

Copy link
Copy Markdown
Collaborator

The first popup when attempting a first query works great. It just finished running the query and is great.

Including for visibility a few things I noticed, that seem to be unrelated to the work you did. Not sure how/when we want to address them, so just listing them here

  1. You can break things when copy/pasting in a way that isn't obvious. I.e. if you put in the correct key but a bad model name, the form goes away but you just get failed queries and no errors except for in the console.
  • E.g. anthropic.NotFoundError: Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'model: claude-4-6'}
  • Probably should expose all errors communicating with the model, and open the panel back up if you get a 404 and not just a Forbidden.
  1. The flow with setting the model is so smooth, it makes changing through the side panel feel extremely clunky with the modal and restarting the kernel and refreshing things.
  2. The default models are SUPER old at this point and could do with a refresh.
  3. There's just enough lag when loading the configuration popup (at least for me) that it makes one wonder if there is something wrong. Having some sort of loading indicator would be awesome (or just make it slightly faster).
  • I suspect the slowness is because it's importing all the archytas models and related langchain models which are notoriously slow to import.

@mattprintz mattprintz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good.

I left some things I noticed in the comment, but they aren't blockers for this I think.

@brandomr

brandomr commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

These are all very good points. I noticed the lag as well on loading. I want to think a bit about new user onboarding in general. The modal exposes things most users wouldn't even know what to do with (I think?) so we may want to streamline it. We may also need some instruction on how to actually get an API key. I'll think on it more.

brandomr and others added 5 commits July 1, 2026 13:31
…fig UI

get_providers() imported every archytas model module; a single module that
fails to import (e.g. an upstream dependency mismatch) raised, which bubbled up
through the config-schema builder and blanked the entire provider-configuration
dialog (no API-key field, etc.). Now a failing module is skipped with a warning,
and discovery is cached so broken imports aren't re-attempted/re-logged on every
call.

Also harden ConfigController.map_type: guard issubclass() against non-class
type origins (e.g. typing.Literal[...]) and stop swallowing errors silently so a
genuine schema-build failure is logged instead of producing a fieldless schema.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The provider form was styled via a dead id (#config-panel-provider, left with a
debug `background-color: blue`) so it was never placed in its grid cell and its
fields overflowed down onto the Reset/Cancel/Save row. Point the rule at the
real element and let it scroll within the cell (min-height: 0 + overflow-y).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The query cell's message hook only tagged msg.cell for the "Request interrupted"
case, so on an llm_auth_failure the model-config dialog had no cell to re-run --
the user's prompt was silently dropped and they had to re-type it. Tag the
auth-failure message with its originating cell so it re-runs once a provider is
configured.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When credentials are configured at runtime, set_agent_model swapped the agent's
model but not the chat history's, leaving the chat-history panel (which reads
model metadata and token budgets from the chat history) stuck on the keyless
default. Route the change through agent.set_model() so both stay consistent.

Requires archytas with Agent.set_model().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mattprintz
mattprintz force-pushed the fix/provider-onboarding-flow branch from 830010e to e1de09e Compare July 1, 2026 19:32
@mattprintz
mattprintz merged commit 2f77c54 into dev Jul 1, 2026
@mattprintz
mattprintz deleted the fix/provider-onboarding-flow branch July 1, 2026 19:33
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.

2 participants