ruby_coded 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35cd5d9fc4b17b8a4aa4cefce67e02f6be01053fef3cb73046281804434a3d85
4
- data.tar.gz: 4b53ca7258244edcc8cb1e7c31dfadc91c2c897b9b24acea3e5cdac21d086485
3
+ metadata.gz: a1980b8f52a5fefcd383aec24380904430c10654b4cffe7bef6288b1b55e1eed
4
+ data.tar.gz: 1e54670c24db8f43ce9a0e4391889adf3d2d1c75f0923d43ff3260bc210e2e96
5
5
  SHA512:
6
- metadata.gz: 00d9c124eeadef16b3492f6c2e394a439cff10a92516afedb053d9626a83d2029d96ceaa1898f8da4f4d4a29ae8c1876ef181f0e20259fb401b30e76a972f341
7
- data.tar.gz: eb10ce9285ba09b7cf9cd3e24caf6dd28938586328b49e0cb155560ab58697d5e2fbda3ce8da3b61492ba7c23ccd2e8236307f260b1588430cbd63102aee82ff
6
+ metadata.gz: c4d75ef0c6c7d0b3d1da17287b08bbdec2d9ee29bcc12c8551409ae2dbf2276562a10fc96294a9685b55a41f36d4711e448a640e97bb2711a9da9e0b1231e5ad
7
+ data.tar.gz: 75d2f43c84b9c8d027d17ac6d61b2f250fef6ce2dca88463b3ab580f74927bb16933b5a6f96eb7fed6b26e5138c621e9df8b56435f364dcbe3173c72f3a10114
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.2] - 2026-04-17
4
+
5
+ ### Fixed
6
+
7
+ - **OAuth credentials lost after in-TUI login**: When logging in to OpenAI via OAuth from within the chat (`/login`) while already authenticated with another provider (e.g. Anthropic) and using a non-Codex model, the freshly stored OAuth credentials were wiped from `~/.ruby_coded/config.yaml`. The root cause was two `UserConfig` instances holding independent in-memory copies of the config; when `ensure_valid_codex_model!` called `@user_config.set_config("model", "gpt-5.4")`, the stale hash (loaded before the OAuth login) was serialized back to disk, overwriting the OAuth credentials written moments earlier by `CredentialsStore`. Fixed by threading a single shared `UserConfig` through `Initializer`, `AuthManager`, `CredentialsStore` and `Chat::App`.
8
+
3
9
  ## [0.2.1] - 2026-04-17
4
10
 
5
11
  ### Fixed
@@ -29,10 +35,10 @@
29
35
  - AuthManager skips OpenAI OAuth credentials for RubyLLM configuration (handled by CodexBridge)
30
36
  - Default OpenAI model updated to `gpt-5.4`
31
37
 
32
- ## [0.1.0] - 2026-04-15
33
-
34
- - Initial release
35
-
36
38
  ## [0.1.1] - 2026-04-15
37
39
 
38
40
  - Fix CI workflow
41
+
42
+ ## [0.1.0] - 2026-04-15
43
+
44
+ - Initial release
@@ -21,8 +21,9 @@ module RubyCoded
21
21
  anthropic: Providers::Anthropic
22
22
  }.freeze
23
23
 
24
- def initialize(config_path: UserConfig::CONFIG_PATH)
24
+ def initialize(config_path: UserConfig::CONFIG_PATH, user_config: nil)
25
25
  @config_path = config_path
26
+ @user_config = user_config
26
27
  end
27
28
 
28
29
  def login(provider_name)
@@ -113,7 +114,7 @@ module RubyCoded
113
114
  end
114
115
 
115
116
  def credential_store
116
- @credential_store ||= CredentialsStore.new(config_path: @config_path)
117
+ @credential_store ||= CredentialsStore.new(config_path: @config_path, user_config: @user_config)
117
118
  end
118
119
 
119
120
  def extract_api_key(credentials)
@@ -8,8 +8,8 @@ module RubyCoded
8
8
  module Auth
9
9
  # This class is used to manage the credentials in the config file
10
10
  class CredentialsStore
11
- def initialize(config_path: UserConfig::CONFIG_PATH)
12
- @config = UserConfig.new(config_path: config_path)
11
+ def initialize(config_path: UserConfig::CONFIG_PATH, user_config: nil)
12
+ @config = user_config || UserConfig.new(config_path: config_path)
13
13
  end
14
14
 
15
15
  def store(provider_name, credentials)
@@ -41,7 +41,7 @@ module RubyCoded
41
41
 
42
42
  def build_components!
43
43
  @state = State.new(model: @model)
44
- @credentials_store = Auth::CredentialsStore.new
44
+ @credentials_store = Auth::CredentialsStore.new(user_config: @user_config)
45
45
  @llm_bridge = create_bridge
46
46
  @input_handler = InputHandler.new(@state)
47
47
  @command_handler = build_command_handler
@@ -19,7 +19,7 @@ module RubyCoded
19
19
  def initialize
20
20
  @user_cfg = UserConfig.new
21
21
  @prompt = TTY::Prompt.new
22
- @auth_manager = Auth::AuthManager.new
22
+ @auth_manager = Auth::AuthManager.new(user_config: @user_cfg)
23
23
  @fallback_from_model = nil
24
24
 
25
25
  ask_for_directory_permission unless @user_cfg.directory_trusted?
@@ -2,7 +2,7 @@
2
2
 
3
3
  # This module contains the version of the RubyCoded gem
4
4
  module RubyCoded
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
 
7
7
  def self.gem_version
8
8
  Gem::Version.new(VERSION).freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_coded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cesar Rodriguez