Skip to content

feat: add ability to attach source to an environment - #809

Merged
qstearns merged 29 commits into
mainfrom
quinn/source-environments
Nov 12, 2025
Merged

feat: add ability to attach source to an environment#809
qstearns merged 29 commits into
mainfrom
quinn/source-environments

Conversation

@qstearns

@qstearns qstearns commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Allows attaching environments to sources for all callers.

This introduces the distinction between a System Environment and User Configuration to the system. These names might be stupid but they attempt to get around the idea that Headers are more of an implementation detail and the rules associated with how you merge these things should be derived from their provenance rather than how they were supplied.

We make some decisions. First off, we complect the call sites of tool proxies by placing the onus of loading on them. This was more or less in the name of purity of the tools proxy. But might be a mistake because it forces the onus of reading system environments to a bunch of places in our code base. It's possible it's a little bug-prone to do this nonsense in a bunch of places.

The other decision, which I feel a little better about is to provide both environments to each tool type and leave the responsibility of merging them at the call site. Even though we aim for consistent behavior (ie. preferring user config over system environment), leaving the flexibility on how to merge each tool type seems healthy.

UX

A dialog attached to source cards. Not good.

Affordance to access functionality is currently buried behind:

image

The interface for attaching an environment is implemented in this modal:

image
  • We use a combobox
  • We try to preview what variables will be set to make more mistakes more obvious
  • Currently pretty ugly, but banking on the UX moving to a new location shortly before I figure out a good hierarchy for presenting. Happy to knock any quick fixes to make this present better if people feel strongly

Things to pay Attention To

  • Moved sources components to new directory, but also changed the modal paradigm (separate content components, used zustand for state management)
  • I ported all of the Dialogs and Dropdown Menu's to the moonshine versions of those components. I couldn't visually tell the difference and there were some really nasty interplay issues. Hoping this is a nice stability move

Considerations

  • Might consider adding a confirmation button considering this action is a pretty serious one
  • UX is quite ugly at the moment. Preferring to follow up with a dedicated sources page instead of burying behind a dialog
  • Blocked on this moonshine PR: feat(Combobox): add create to combobox moonshine#319

@qstearns
qstearns requested a review from a team as a code owner November 10, 2025 16:56
@changeset-bot

changeset-bot Bot commented Nov 10, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 394c355

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
dashboard Minor
server Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Nov 10, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
gram Ready Ready Preview Comment Nov 12, 2025 10:08pm
gram-docs-redirect Ready Ready Preview Comment Nov 12, 2025 10:08pm
gram-landing-redirect Ready Ready Preview Comment Nov 12, 2025 10:08pm

@qstearns
qstearns force-pushed the quinn/source-environments branch from e1c6218 to 2f9e885 Compare November 10, 2025 17:57
@qstearns
qstearns force-pushed the quinn/source-environments branch from 2f9e885 to 6173181 Compare November 10, 2025 18:16
@qstearns
qstearns changed the base branch from main to quinn/add-source-environments-table November 10, 2025 18:22
@qstearns
qstearns force-pushed the quinn/source-environments branch from 6173181 to 7d03814 Compare November 10, 2025 18:31
@qstearns
qstearns force-pushed the quinn/add-source-environments-table branch from 303753a to c665eb6 Compare November 10, 2025 18:32
@qstearns
qstearns force-pushed the quinn/source-environments branch from 7d03814 to 5cc8a5f Compare November 10, 2025 18:51
@qstearns
qstearns force-pushed the quinn/source-environments branch from 5cc8a5f to cbc03e8 Compare November 10, 2025 19:23

@ryan-timothy-albert ryan-timothy-albert 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.

Let's deploy to dev and test carefully

…e such that all tool calls originating from that source will have those environment variables apply
move oauth token into environement resolution

exclude server url when system environments are used

pass through all environment variables not specified by plan
move ci env

switch environment parameter for tool proxy
Note that we're removing explicit map sizing because
map size has become unpredictable
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants