Skip to content

refactor: route runtime ui resolver helper#240

Closed
ndycode wants to merge 1 commit intorefactor/pr4-runtime-ui-resolver-helperfrom
refactor/pr4-runtime-ui-resolver-direct2
Closed

refactor: route runtime ui resolver helper#240
ndycode wants to merge 1 commit intorefactor/pr4-runtime-ui-resolver-helperfrom
refactor/pr4-runtime-ui-resolver-direct2

Conversation

@ndycode
Copy link
Copy Markdown
Owner

@ndycode ndycode commented Mar 21, 2026

Summary

  • remove the remaining inline runtime UI resolver wrapper from index.ts
  • route UI runtime resolution directly through the extracted helper

What Changed

  • deleted the inline resolveUiRuntime() wrapper
  • updated current call sites to use resolveRuntimeUiOptions(...) directly with the existing config/runtime dependencies

Validation

  • npm run lint
  • npm run typecheck
  • npm run build

Risk and Rollback

  • Risk level: low
  • Rollback plan: revert eec7ec7 to restore the inline runtime UI resolver wrapper in index.ts

Additional Notes

  • this removes another dispatcher-only runtime wrapper after the helper extraction landed

note: greptile review for oc-chatgpt-multi-auth. cite files like lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.

Greptile Summary

this pr finishes the ui runtime resolver extraction by removing the local resolveUiRuntime() wrapper in index.ts and calling resolveRuntimeUiOptions({ loadPluginConfig, applyUiRuntimeFromConfig }) directly at each call site. the refactor is behavior-preserving — same deps, same side-effect path through applyUiRuntimeFromConfig — and fits cleanly into the lib/runtime/ui-runtime.ts helper established in the prior extraction.

  • 9 call sites updated, but 6 of them have inconsistent indentation for the object literal args (properties pasted at 6-tab depth regardless of the surrounding nesting level). no runtime impact, but worth a cleanup pass.
  • no new vitest coverage added. test/ui-runtime.test.ts covers the helper itself; none of the refactored call sites in index.ts have direct coverage for the inline invocation pattern. project targets 80% threshold — worth noting for a future test pass.
  • no concurrency concerns introduced: each call is synchronous and stateless relative to the auth rotation paths.
  • no windows filesystem or token safety risks from this change.

Confidence Score: 4/5

  • safe to merge; logic is correct and behavior-preserving, only formatting issues remain
  • the refactor correctly eliminates the wrapper without changing semantics — same deps forwarded, same side-effect triggered at each site. the only real gaps are cosmetic indentation inconsistencies at 6 call sites and the absence of new vitest coverage for the inlined call pattern. neither blocks correctness or production reliability.
  • index.ts — indentation of object args at the init call (~line 563) and the deeply-nested execute() blocks (~4097, ~4386, ~4530, ~4621, ~4673)

Important Files Changed

Filename Overview
index.ts removes the inline resolveUiRuntime() wrapper and expands resolveRuntimeUiOptions({...}) inline at 9 call sites; logic is behavior-preserving, but 6 of those sites have mis-indented object args and no new vitest coverage was added for the refactored call pattern

Sequence Diagram

sequenceDiagram
    participant P as OpenAIOAuthPlugin (index.ts)
    participant H as resolveRuntimeUiOptions (lib/runtime/ui-runtime.ts)
    participant C as loadPluginConfig
    participant A as applyUiRuntimeFromConfig

    note over P: plugin load (init)
    P->>H: resolveRuntimeUiOptions({ loadPluginConfig, applyUiRuntimeFromConfig })
    H->>C: loadPluginConfig()
    C-->>H: TConfig
    H->>A: applyUiRuntimeFromConfig(config)
    A-->>H: UiRuntimeOptions (side-effect: sets UI runtime state)
    H-->>P: UiRuntimeOptions (discarded at init)

    note over P: tool execute() calls (codex-list, codex-status, etc.)
    P->>H: resolveRuntimeUiOptions({ loadPluginConfig, applyUiRuntimeFromConfig })
    H->>C: loadPluginConfig()
    C-->>H: TConfig
    H->>A: applyUiRuntimeFromConfig(config)
    A-->>H: UiRuntimeOptions
    H-->>P: ui (used for v2Enabled / theme / glyphMode checks)
Loading

Fix All in Codex

Prompt To Fix All With AI
This is a comment left during a code review.
Path: index.ts
Line: 563-566

Comment:
**inconsistent indentation on init call**

the opening brace is at 1-tab depth but the object properties are pasted at 6-tab depth — they should be 2 tabs. the same mis-indentation pattern repeats at every deeply-nested `execute()` site (~4100, ~4386, ~4530, ~4621, ~4673 in the diff). six of the nine new call sites have this issue. no runtime impact but it's inconsistent with the surrounding code style.

```suggestion
	resolveRuntimeUiOptions({
		loadPluginConfig,
		applyUiRuntimeFromConfig,
	});
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: index.ts
Line: 4097-4103

Comment:
**object args under-indented relative to call site**

`loadPluginConfig` / `applyUiRuntimeFromConfig` are pasted at 6-tab depth but `const ui = resolveRuntimeUiOptions({` is at 8-tab depth — properties should be at 9 tabs to match. same pattern appears in `codex-remove` (~4386), `codex-refresh-all` (~4530), `codex-export` (~4621), and `codex-import` (~4673).

```suggestion
							const ui = resolveRuntimeUiOptions({
								loadPluginConfig,
								applyUiRuntimeFromConfig,
							});
```

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: "refactor: route runt..."

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 21, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • skip-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 747ce2ec-c749-4873-b684-06a3c2ca34dd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/pr4-runtime-ui-resolver-direct2
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch refactor/pr4-runtime-ui-resolver-direct2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@ndycode ndycode added the passed label Mar 21, 2026
ndycode added a commit that referenced this pull request Mar 23, 2026
@ndycode
Copy link
Copy Markdown
Owner Author

ndycode commented Mar 23, 2026

Closing because this work is now included in main via #318 and #319.

@ndycode ndycode closed this Mar 23, 2026
@ndycode ndycode deleted the refactor/pr4-runtime-ui-resolver-direct2 branch March 24, 2026 18:34
ndycode added a commit that referenced this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant