FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Rename package to opencode-openai-codex-auth-multi by ndycode · Pull Request #1 · ndycode/oc-codex-multi-auth · GitHub

Rename package to opencode-openai-codex-auth-multi - #1

Merged
ndycode merged 1 commit into
mainfrom
multiaccount-main
Jan 5, 2026
Merged

ndycode merged 1 commit into
mainfrom
multiaccount-main

Conversation

ndycode commented Jan 5, 2026

Copy link
Copy Markdown
Owner

No description provided.

ndycode merged commit 0d8d2e5 into main Jan 5, 2026
ndycode added a commit that referenced this pull request Apr 6, 2026
…s (v2.1.2)

This release includes comprehensive OpenAI ToS compliance updates and fixes
4 critical bugs that prevented per-model options and multi-turn conversations
from working correctly.

## 🔒 Compliance & Legal Updates

### Terms of Service & Usage Guidelines
- Added comprehensive ToS & Usage Notice to README emphasizing personal use only
- Added Rate Limits & Responsible Use section with best practices
- Added extensive FAQ section addressing TOS compliance questions
- Updated LICENSE with MIT + Usage Disclaimer for personal development use
- Added compliance header to index.ts documenting intended use cases

### New Documentation
- **CONTRIBUTING.md**: Complete contribution guidelines with compliance requirements
- **SECURITY.md**: Security policy, vulnerability reporting, best practices
- **docs/privacy.md**: Comprehensive privacy & data handling documentation
- **Issue Templates**: Bug reports & feature requests with compliance checklists

### Documentation Updates
- Updated docs/index.md with usage notice and trademark disclaimers
- Updated docs/getting-started.md with "Before You Begin" compliance notice
- Updated docs/troubleshooting.md with subscription & compliance sections
- All references updated to "Plus/Pro" (removed Team/Enterprise mentions)

### Key Compliance Principles
- ✅ Emphasizes personal development use with own ChatGPT Plus/Pro subscription
- ✅ Uses OpenAI's official OAuth authentication (same as Codex CLI)
- ✅ Clear prohibition of commercial resale, multi-user services
- ✅ Not a "free API alternative" - uses existing ChatGPT subscription
- ✅ Proper trademark notices and attribution to OpenAI
- ✅ Transparent about data handling and privacy

## 🐛 Critical Bug Fixes

### Bug #1: Per-Model Options Ignored (Config Lookup Mismatch)
**Severity:** 🔴 HIGH

Users configured different reasoning levels for each model variant, but all
variants behaved identically because the plugin was looking up normalized
model names instead of the original config keys.

**Fix:** lib/request/request-transformer.ts:277
- Use original model name for config lookup before normalization
- Allows per-model options to work correctly
- Impact: Different reasoning levels now properly applied per variant

### Bug #2: Multi-Turn Conversations Fail (AI SDK Compatibility)
**Severity:** 🔴 CRITICAL

Multi-turn conversations failed with "Item not found" errors because:
1. AI SDK sends `item_reference` (not in Codex API spec)
2. IDs weren't completely stripped for stateless mode (store: false)

**Fix:** lib/request/request-transformer.ts:114-135
- Filter out AI SDK `item_reference` items
- Strip ALL IDs from remaining items (not just rs_* prefix)
- Confirmed ChatGPT backend requires store: false via testing
- Full message history preserved for LLM context

### Bug #3: Case-Sensitive Normalization
**Severity:** 🟡 MEDIUM

**Fix:** lib/request/request-transformer.ts:22-27
- Added toLowerCase() for case-insensitive matching
- Backwards compatible with old verbose config names
- Handles uppercase/mixed case user input

### Bug #4: GitHub API Rate Limiting
**Severity:** 🟡 MEDIUM

Plugin checked GitHub on every request, exhausting 60 req/hour limit.
15-minute cache timestamp was stored but never checked.

**Fix:** lib/prompts/codex.ts:50-53, lib/prompts/opencode-codex.ts:47-50
- Check cache TTL before GitHub API call
- Only fetch if cache >15min old
- Prevents rate limit exhaustion during testing

## ✨ Enhancements

### Debug Logging System
- New environment variable: `DEBUG_CODEX_PLUGIN=1`
- Added logDebug() and logWarn() functions
- Shows config lookups, ID filtering, options resolution
- File: lib/logger.ts

### Optimized Config Structure
- Changed to Codex CLI preset names (gpt-5-codex-low, etc.)
- Removed redundant `id` field (not used by OpenAI provider)
- Added `name` field for friendly TUI display
- File: config/full-opencode.json

### GitHub Pages Documentation
- Complete documentation restructure for GitHub Pages
- User guides: getting-started.md, configuration.md, troubleshooting.md
- Developer guides: ARCHITECTURE.md, CONFIG_FLOW.md, CONFIG_FIELDS.md, TESTING.md
- Privacy policy, security policy, contribution guidelines

## 🧪 Testing

### Test Coverage
- ✅ 159 unit tests passing (30+ new tests)
- ✅ 14 integration tests passing (actual API verification)
- ✅ All documented scenarios have test coverage

### Integration Tests (scripts/test-all-models.sh)
- Tests all 9 custom model configurations
- Tests all 4 default OpenCode models
- Verifies backwards compatibility with old config format
- Uses ENABLE_PLUGIN_REQUEST_LOGGING to verify actual API requests

### Test Results
- 14/14 model configuration tests passing
- All per-model options verified correct
- Multi-turn conversations work without errors
- Backwards compatibility confirmed

## 📝 Files Changed

### Modified (7 files)
- lib/request/request-transformer.ts: Config lookup & ID filtering fixes
- lib/prompts/codex.ts: 15-minute cache TTL
- lib/prompts/opencode-codex.ts: 15-minute cache TTL
- lib/logger.ts: Debug logging system
- config/full-opencode.json: Optimized structure
- test/request-transformer.test.ts: 30+ new tests
- LICENSE: Added usage disclaimer
- index.ts: Added compliance header
- README.md: Added ToS, Rate Limits, FAQ sections

### Created (20+ files)
- CONTRIBUTING.md: Contribution guidelines
- SECURITY.md: Security policy
- docs/index.md: GitHub Pages landing
- docs/getting-started.md: Installation guide
- docs/configuration.md: Advanced config
- docs/troubleshooting.md: Debug guide
- docs/privacy.md: Privacy policy
- docs/development/ARCHITECTURE.md: Technical architecture
- docs/development/CONFIG_FLOW.md: Config system internals
- docs/development/CONFIG_FIELDS.md: Field usage guide
- docs/development/TESTING.md: Testing guide
- .github/ISSUE_TEMPLATE/bug_report.md
- .github/ISSUE_TEMPLATE/feature_request.md
- .github/ISSUE_TEMPLATE/config.yml
- scripts/test-all-models.sh: Automated testing

## 🎯 Verification

All scenarios tested and verified:
- ✅ Default models work without config
- ✅ Custom models with per-variant options
- ✅ Old config format (backwards compatible)
- ✅ Mixed default + custom models
- ✅ Multi-turn conversations (no "item not found" errors)
- ✅ Model switching with different options
- ✅ All normalization patterns
- ✅ Complete ID filtering

## 📚 Documentation

Complete documentation suite (100+ KB):
- User guides for installation, configuration, troubleshooting
- Developer guides for architecture, config system, testing
- Privacy policy and security policy
- Compliance guidelines and contribution requirements
- Release notes in tmp/release-notes/

## 🔗 References

- OpenAI Terms of Use: https://openai.com/policies/terms-of-use/
- OpenAI Usage Policies: https://openai.com/policies/usage-policies/
- OpenAI Platform API: https://platform.openai.com/
- OpenAI Codex CLI: https://github.com/openai/codex

🤖 Generated with [Claude Code](https://claude.com/claude-code)
ndycode added a commit that referenced this pull request Apr 6, 2026
Rename package to opencode-openai-codex-auth-multi
Nowaker added a commit to Nowaker/oc-codex-multi-auth that referenced this pull request Sep 17, 2026
The prompt status line names whichever account served the most recent
request. On one account that is exactly right. On a pool of seven it
changes identity as rotation moves, so the corner of the screen
flickers between accounts and the only way to learn where the pool
stands is to keep watching until every account has gone past.

`quotaStatus.mode: "overview"` renders the pool instead: every account
at once, in a fixed order, so the line changes only when a quota does.

    24%: ndycode#1 5x 13%, ndycode#2 20x 100% 3d 1r, ndycode#3 1x 12%

The leading figure is the pool total, and it is a weighted mean rather
than a plain one - lib/plan-allotment.ts supplies the per-plan ratio,
because averaging a Pro seat and a Business Standard seat as equals
describes a pool nobody has. Each account is summarised by its
governing window: the one with the least headroom, since that is what
stops a request, and on a tie the one that blocks for longer. A reset
time is printed only for an account at or below 25% headroom, which is
the threshold the single-account line already uses for the same
question.

Everything beyond the total is a switch, so the line can be as bare as
`24%: 3 accounts` or carry allotment badges, reset times, banked reset
counts and the pool's next recovery (`+12% in 3d`). Defaults are the
per-account breakdown and reset times; badges, banked counts and
recovery are opt-in. `active` stays the default mode, because it is
what every existing install already has and because on one account the
two modes say the same thing at different lengths.

Percentages follow `quotaDisplay` like every other surface, so the same
pool reads `24%` as headroom or `76%` as consumption, and the recovery
clause flips sign with it because it annotates a number that moves the
other way under `used`. Only the wording changes: which window governs
an account, which account is closest to recovering, and the line's
warning/danger colouring all stay keyed on the percentage remaining.

The data costs no extra requests. The quota guard already polls every
enabled account on a bounded interval and throws the per-account detail
away; lib/tui-quota-overview.ts gathers the same read into a pool
snapshot cached beside the existing one. It is a separate file
deliberately: the request path pushes one account per response, and
folding the two together would make every response rewrite a document
describing accounts that request never touched. That live single-account
push is merged back over the polled snapshot when it is newer, so the
one account whose figure a reader can check against their own activity
is not the one that looks stale.

The line degrades by preference rather than by length, dropping the
recovery clause, then the annotations, then the breakdown, leaving the
pool total last. Sorting by length instead would let a form win or lose
by two characters as a percentage crossed from `9%` to `10%`, and the
line would change shape while the reader watched - the flicker this
mode exists to remove.

Its width budget reserves room for the model label sharing the row.
Measured in a real TUI at 80 columns, a 48-character line was
ellipsized through its middle, destroying account numbers and reset
times either side of the cut, and pushed the label onto a second row.

AI-Tool: opencode
AI-Model: anthropic/claude-opus-5
AI-Platform: linux
AI-Harness: Vibeterm 5611cee
Nowaker added a commit to Nowaker/oc-codex-multi-auth that referenced this pull request Sep 19, 2026
The pool-wide status line said one thing one way. This makes the whole
shape of it configurable, in the config file and nowhere else: a display
preference belongs to a person, not to whichever shell started OpenCode,
so the `CODEX_AUTH_QUOTA_STATUS*` overrides are gone and every field
below is read from `~/.opencode/openai-codex-auth-config.json` alone.

`layout` replaces the `accounts` boolean and adds a third arrangement.
`aggregate` prints a shared percentage once and keeps only what differs
after it, which is most of the line back on a pool where several seats
are spent:

    72%: 12% 3d, 50% 4d, 100% 3d 1r 4d 5d

A group states its own size - `100% x3 4d 5d` - only when its
annotations would not already reveal it, so a group of three where one
member has no reset to print cannot read as a group of two.

`accountNames` chooses between `ndycode#1`, the name the account's owner gave
it, and nothing at all. `order` arranges the accounts by number, by
consumption in either direction, or by which renews first or last, and
every comparison falls back to the account number so two seats reading
the same percentage never trade places between renders.

`allotment` states what the weighted pool adds up to (`66% of 65x`),
over exactly the accounts the mean is taken over so the two figures
cannot disagree. `resetTimes` grows from a boolean into
`never`/`low`/`always`, because 90% spent with an hour to go and 90%
spent with six days to go are not the same situation.

`mode` accepts a list and the line then alternates between those
screens every `rotateMs`. A screen with nothing to say is skipped rather
than shown blank, which is what makes the third screen worth leaving in
the list permanently: `resets` renders only once every account is spent,
and lists the banked credits worth redeeming, latest reset first -
redeeming one on an account that renews by itself tomorrow throws it
away.

    Free resets: 6d 1r damian@nowaker.net, 4d 2r work@example.com

Narrow terminals lose less. `3 accounts` steps through `3 acct.` to `3`
before the line gives up on the count, the recovery clause drops the
word `in` before dropping the clause, and an unnamed breakdown is
offered as the last rung above the count - but only while position still
identifies an account, which means number order with nothing missing
from the line.

Two things about the slot itself, both found by watching the real TUI
rather than by reading it. The budget now comes from the prompt row's
measured width rather than the terminal's, because an open sidebar takes
a share nothing here can derive - at 165 columns a 95-character line was
being ellipsized through its middle, destroying account numbers either
side of the cut. And the line is top-aligned and may occupy up to `rows`
of them, where the host had been centring a one-row line against a model
label that wraps to two, leaving the top row empty.

The label's own width and height are deliberately not measured, and both
were tried and reverted here. The row sizes both boxes by their content
with `alignItems: stretch`, so the label reports this line's height once
this line grows and is shrunk to whatever this line did not take once
the row is full; either reading makes the budget a function of its own
output. `rows` is therefore a plain ceiling, which costs nothing until
the content needs the room.

`showFor` can hide the line unless the session is running a model this
plugin routes. It defaults to showing it always, which is what every
install already does.

An earlier build of this feature spelled two of these fields
differently, and `PluginConfigSchema` validates the file as one unit, so
`accounts: false` and `resetTimes: true` are still accepted and still
mean what they meant. One stale value must not reset every other plugin
setting in the file.

AI-Tool: opencode
AI-Model: anthropic/claude-opus-5
AI-Platform: linux
AI-Harness: Vibeterm 212720d
Nowaker added a commit to Nowaker/oc-codex-multi-auth that referenced this pull request Sep 19, 2026
The pool-wide status line said one thing one way. This makes the whole
shape of it configurable, in the config file and nowhere else: a display
preference belongs to a person, not to whichever shell started OpenCode,
so the `CODEX_AUTH_QUOTA_STATUS*` overrides are gone and every field
below is read from `~/.opencode/openai-codex-auth-config.json` alone.

`layout` replaces the `accounts` boolean and adds a third arrangement.
`aggregate` prints a shared percentage once and keeps only what differs
after it, which is most of the line back on a pool where several seats
are spent:

    72%: 12% 3d, 50% 4d, 100% 3d 1r 4d 5d

A group states its own size - `100% x3 4d 5d` - only when its
annotations would not already reveal it, so a group of three where one
member has no reset to print cannot read as a group of two.

`accountNames` chooses between `ndycode#1`, the name the account's owner gave
it, and nothing at all. `order` arranges the accounts by number, by
consumption in either direction, or by which renews first or last, and
every comparison falls back to the account number so two seats reading
the same percentage never trade places between renders.

`allotment` states what the weighted pool adds up to (`66% of 65x`),
over exactly the accounts the mean is taken over so the two figures
cannot disagree. `resetTimes` grows from a boolean into
`never`/`low`/`always`, because 90% spent with an hour to go and 90%
spent with six days to go are not the same situation.

`mode` accepts a list and the line then alternates between those
screens every `rotateMs`. A screen with nothing to say is skipped rather
than shown blank, which is what makes the third screen worth leaving in
the list permanently: `resets` renders only once every account is spent,
and lists the banked credits worth redeeming, latest reset first -
redeeming one on an account that renews by itself tomorrow throws it
away.

    Free resets: 6d 1r damian@nowaker.net, 4d 2r work@example.com

Narrow terminals lose less. `3 accounts` steps through `3 acct.` to `3`
before the line gives up on the count, the recovery clause drops the
word `in` before dropping the clause, and an unnamed breakdown is
offered as the last rung above the count - but only while position still
identifies an account, which means number order with nothing missing
from the line.

Two things about the slot itself, both found by watching the real TUI
rather than by reading it. The budget now comes from the prompt row's
measured width rather than the terminal's, because an open sidebar takes
a share nothing here can derive - at 165 columns a 95-character line was
being ellipsized through its middle, destroying account numbers either
side of the cut. And the line is top-aligned and may occupy up to `rows`
of them, where the host had been centring a one-row line against a model
label that wraps to two, leaving the top row empty.

The label's own width and height are deliberately not measured, and both
were tried and reverted here. The row sizes both boxes by their content
with `alignItems: stretch`, so the label reports this line's height once
this line grows and is shrunk to whatever this line did not take once
the row is full; either reading makes the budget a function of its own
output. `rows` is therefore a plain ceiling, which costs nothing until
the content needs the room.

`showFor` can hide the line unless the session is running a model this
plugin routes. It defaults to showing it always, which is what every
install already does.

An earlier build of this feature spelled two of these fields
differently, and `PluginConfigSchema` validates the file as one unit, so
`accounts: false` and `resetTimes: true` are still accepted and still
mean what they meant. One stale value must not reset every other plugin
setting in the file.

AI-Tool: opencode
AI-Model: anthropic/claude-opus-5
AI-Platform: linux
AI-Harness: Vibeterm 212720d
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL