Skip to content

Context window exceeded despite context left #2825

@dlukt

Description

@dlukt

What version of Codex is running?

codex-cli 0.25.0

Which model were you using?

gpt-5 high

What platform is your computer?

Linux 6.16.3-arch1-1 x86_64 unknown

What steps can reproduce the bug?

codex
Implemented likes for games and reactions for files, plus wired basic UI for game likes. Also completed comment rate limiting and comment UI as requested earlier.

What’s new

Backend

- Ent schemas:
    - GameLike: user_id + Game edge with unique (user_id, game) index.
    - FileReaction: user_id, value(-1/+1) + File edge with unique (user_id, file).
    - Edges on Game → likes and File → reactions (Relay connections).
    - Comment schema already added (with sanitization).
- GraphQL API (api/custom.graphqls):
    - Mutations:
    - rateGame(gameId, like: Boolean!): Game!
      - like=true creates the like; like=false removes it.
    - reactToFile(fileId, value: Int!): File!
      - value ∈ {-1, 1} sets reaction; 0 clears existing reaction.
    - addComment/editComment/deleteComment (from earlier) are in place.
- Query tweaks retained:
    - searchGames with sort; FTS-backed opensearchSuggestions.
- Resolvers (graph/custom.resolvers.go):
    - Implemented rateGame and reactToFile with auth checks and upsert/toggle logic.
    - addComment, editComment, deleteComment implemented previously; added per-minute comment rate limit via AllowComment(user, ip).

Rate limits

- internal/rate:
    - Added per-minute buckets and AllowComment(userID, ip) with env tunables:
    - RATE_LIMIT_ANON_COMMENTS_PER_MIN (default 5)
    - RATE_LIMIT_USER_COMMENTS_PER_MIN (default 15)

Frontend

- GameDetail:
    - Displays like count (Game.likes totalCount).
    - Like/Unlike buttons (simple reload after mutation).
    - Comments list and add form (sanitized display).
- Search:
    - Filters (platform/year/format), sort selector, load-more append.
    - Header search input navigates to /search.
- Removed shadcn/ui previously; all buttons now standard Tailwind-styled.

Changelog

- Added entries for Comments (schema/CRUD/rate limits/UI) and earlier search/observability items.

What’s left for likes/reactions (nice-to-haves)

- File reactions UI: add thumbs up/down in file rows; query likes/dislikes counts via reactions(where:{value:1/-1}). We can wire that next.
- Show like state per user on GameDetail (needs user-like query; currently only totalCount).
- Optimistic updates or local state to avoid full reloads after mutations.

Open issues remaining

- #43 Moderation route polish
- #40 FE: Game page UGC (we’ve started—comments/likes; reactions UI pending)
- #41/#29/#28 Collections/Favorites
- #30 Video links
- #21/#22/#23 Descriptions sanitize/version/history
- #37 Feature flags
- #38/#39 QA tests
- #20 Tracker
- #31 (FTS index) functionally complete via #58; can be closed as done

If you want, I can:

- Add file reactions UI (thumbs up/down) and display counts on GameDetail.
- Add a user-like indicator for the game and toggle the button state accordingly.
- Close #31 and move onto collections/favorites (#28/#29/#41).

user
yes

>_
  ✓ 📖 GameDetail.tsx
⚠  stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 1/5 in 191ms…

⚠  stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 2/5 in 420ms…

⚠  stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 3/5 in 746ms…

⚠  stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 4/5 in 1.505s…

⚠  stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 5/5 in 3.516s…


🖐  stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.

▌ Explain this codebase                                                                                                                                                                    
 ⏎ send   Ctrl+J newline   Ctrl+T transcript   Ctrl+C quit   1883319 tokens used   32% context left

What is the expected behavior?

with 32% context left, no issues

What do you see instead?

see above

Additional information

maybe it's just task context


Note to me too/same here commenters, it would probably help if you included your codex-cli version

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions