Repository navigation
feat(config): move runtime media defaults under ~/.infer/tmp and rename auth.json to auth.yaml - #1239
Merged
Merged
Conversation
…me auth.json to auth.yaml
text_to_speech.output_dir, speech_to_text.recordings_dir and channels.telegram.media.dir now default to ~/.infer/tmp/{tts,voice,media}. The tmp dir is already in UserspaceRuntimeDirNames, so the agent sandbox reaches the subdirs and /reset wipes them via the existing loop - the per-dir appends in ResetShortcut.targets() are gone, and dirs explicitly overridden outside ~/.infer are deliberately left alone.
auth.json becomes auth.yaml with a read-only fallback to the legacy JSON file (JSON is a subset of YAML, one parse covers both) so existing credentials are not orphaned. auth.yaml joins the default protected_paths.
edenreich
reviewed
Sep 18, 2026
… migration
docs/directory-structure.md gains tmp/{tts,voice,media}, telemetry/ and run/ in the userspace tree and Created at Runtime list, a File Formats rule (hand-edited files are YAML, machine-written state stays JSON) and an Existing Installs note describing the one-time move of the old ~/.infer/{tts,voice,media} directories. speech-to-text, text-to-speech, channels, configuration-reference, README and the telegram example now point at the new default paths and the auth.yaml rename.
Closed
3 tasks
inference-gateway-maintainer
Bot
marked this pull request as ready for review
September 18, 2026 13:52
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
September 18, 2026 13:52
Closed
7 tasks
5 tasks
…l by name writeLegacyAuthFile was writeAuthFile with one word changed; both now wrap a shared writeAuthFileNamed that reuses an already-set temp HOME, so a test can seed auth.yaml and auth.json together. TestLoadAuthKeys_LegacyUnreadableFile re-tested the same err != nil branch as TestLoadAuthKeys_UnreadableFile and is gone. The new sandbox case pointed at .infer/auth.yaml, which the .infer/ rule in ProtectedPaths already blocks, so it never exercised the auth.yaml entry it was added for. Moving it outside the config dir makes it hit the bare-name branch.
5 tasks
The desktop's sidebar state moves to ~/.infer/projects.yaml alongside desktop.yaml (inference-gateway/desktop#283), so the file-format rule for ~/.infer/ is now: anything a human may open is YAML, only opaque caches and cursors stay JSON. The CLI never parsed projects.json - it only carved the name out of the agent sandbox and preserved it across /reset - so this swaps the carve-out to the YAML name. The state is regenerable, so the app rebuilds it rather than carrying two formats.
auth.yaml is the only provider-key file the CLI looks at. The legacy read, its constant, the two fallback test cases and the auth.json protected_paths entry are gone, along with the migration prose in the README and docs. Also sweeps the stale auth.json references left behind by #1169 in internal/gateway and internal/agent/application, and switches the gateway env fixtures from JSON bodies to the YAML users actually write.
6 tasks
edenreich
added a commit
to inference-gateway/desktop
that referenced
this pull request
Sep 18, 2026
…284) inference-gateway/cli#1239 renamed the userspace provider-key file to auth.yaml and removed the auth.json read path, so keys saved from Settings -> API Keys landed in a file nothing reads. Desktop-spawned runs kept working only because auth_env() injects the pairs as environment variables, which outrank the auth file - running `infer` from a terminal got no keys. Straight rename matching the CLI, no fallback read. serde_norway already backs the config.yaml reader, so this is a serializer swap, not a new dep. The in-memory type becomes BTreeMap<String, String> - what the file and the frontend Record<string, string> both already are, with deterministic key order on write. auth_path/read_auth/write_auth gain a home-rooted seam so the tests run against a temp dir, mirroring read_config_in. Resolves #282
Contributor
|
🎉 This PR is included in version 0.203.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
edenreich
added a commit
to inference-gateway/desktop
that referenced
this pull request
Sep 18, 2026
* refactor(projects): move projects.json and desktop.json to YAML inference-gateway/cli#1239 records the ~/.infer file-format rule: files a human may open are YAML, only opaque caches stay JSON. projects.yaml is on the YAML side twice over - people open it to work out why a chat landed in the wrong project, and the CLI carves it out of the agent sandbox (config.go isWithinConfigSubdir) so the agent can edit it on the user's behalf. Straight rename, no fallback read and no migration: both files hold regenerable sidebar and app state, so carrying two formats would cost more than re-creating a layout once. serde_norway already backs the config.yaml reader, so this is a serializer swap rather than a new dep. The six hand-rolled read-parse-default / write-serialize copies of projects.json across projects.rs, agent.rs and export.rs collapse onto one read_projects_in / write_projects_in pair in projects.rs. The read/write Tauri commands keep their JSON-text contract with the frontend and convert at the boundary, so the webview needs no YAML parser and store.tsx is unchanged. One-time loss: a user still holding projects.json sees a clean sidebar and re-creates grouping and path overrides once. Resolves #283 * Apply suggestion from @edenreich
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1238
Summary
Consolidates the
~/.infer/layout along both axes the issue names. Runtime media dirs (generated speech, retained recordings, Telegram media) now default under~/.infer/tmp/with the other disposable output instead of beside configuration, and the userspace provider-key file becomesauth.yaml(YAML like every other hand-edited file there) with a read-only fallback so existing credentials are not orphaned./resetcovers the moved dirs through the existingUserspaceRuntimeDirNamesloop, so its per-dir appends are gone.Changes
text_to_speech.output_dir,speech_to_text.recordings_dirandchannels.telegram.media.dirdefault to~/.infer/tmp/{tts,voice,media}; explicit overrides keep working unchanged~/.infer/tmpstays inUserspaceRuntimeDirNames, so the agent's file tools can read and writetmp/{tts,voice,media}- that is the point of retaining recordings and media (the agent consumes them as assets) and of generated TTS output (the agent plays and can reference it)ResetShortcut.targets()no longer appends the three resolved dirs;/resetwipes them via thetmpparent, and dirs explicitly overridden outside~/.inferare deliberately left alone (documented in the shortcut's doc comment)auth.jsonrenamed toauth.yaml;LoadAuthKeysfalls back to the legacy JSON file (JSON is a subset of YAML, so one parse covers both formats);auth.yamljoins the defaultprotected_pathsalongsideauth.jsonTestResetShortcut_WipesStateKeepsConfigstill asserts generated speech, recordings and media are emptied, now as~/.infer/tmp/{tts,voice,media}docs/directory-structure.md: hand-edited files are YAML (auth.yaml), machine-written state stays JSON (skills/catalog.json,schedules/github-artifacts-state.json,session_groups.json); no conversion churn for files nobody opensdocs/directory-structure.md(the old dirs hold only disposable retained media); no migration codeDocs
docs/directory-structure.mdis the main update: the userspace tree now showsauth.yaml,tmp/{tts,voice,media},telemetry/andrun/; a File Formats section records the YAML-vs-JSON rule; an Existing Installs section documents the one-time movespeech-to-text.md,text-to-speech.md,channels.md,configuration-reference.md,README.md,examples/telegram-channel/README.md~/.infer/auth.json-backend/src/config.rsreads it (read_auth/get_auth), writes it at 0600 (set_auth) and injects it as env vars (auth_env). Once a user moves keys toauth.yamlas these docs now instruct, the desktop settings UI and the CLI read different stores andset_authsilently overwrites only the JSON one (desktop-spawned runs keep working, because injected env outranks the auth file). Tracked as [TASK] Refactor the provider key store to ~/.infer/auth.yaml desktop#282. Nothing else ripples: desktop'stts_samples.rsuses~/.infer/models/tts/samplesandenv.rsuses~/.infer/tmp/uploads, both untouched by the media dir move.