Skip to content

Fix events list default closed filter#83

Open
DeepCogNeural wants to merge 1 commit into
Polymarket:mainfrom
DeepCogNeural:codex/events-default-open
Open

Fix events list default closed filter#83
DeepCogNeural wants to merge 1 commit into
Polymarket:mainfrom
DeepCogNeural:codex/events-default-open

Conversation

@DeepCogNeural

@DeepCogNeural DeepCogNeural commented Jun 13, 2026

Copy link
Copy Markdown

Summary

  • Make events list send closed=false by default when neither --closed nor --active is provided.
  • Keep explicit --closed behavior and the existing --active to closed mapping.
  • Add a focused unit test for the resolved closed filter, covering default behavior, explicit --closed, --active true, --active false, and --closed precedence.

Why

Gamma /events currently returns closed events when the closed query parameter is omitted. The CLI should request open events by default.

Fixes #71

Validation

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test

Note

Low Risk
Localized CLI query-parameter default for events listing; no auth or data-path changes.

Overview
events list now always sends an explicit closed query parameter instead of omitting it when neither --closed nor --active is set. The default is closed=false (open events), matching expected CLI behavior when Gamma returns closed events if closed is missing.

List request construction is moved into build_events_list_request, which resolves filters as: explicit --closed wins; otherwise --active maps to closed = !active; otherwise false. --active / --closed combinations from before are preserved (e.g. --active alone still implies closed=false).

A unit test (events_list_resolves_closed_filter) locks in those resolution cases.

Reviewed by Cursor Bugbot for commit 7b63a0c. Bugbot is set up for automated code reviews on this repo. Configure here.

@DeepCogNeural DeepCogNeural force-pushed the codex/events-default-open branch from ad8b5c9 to 7b63a0c Compare June 13, 2026 21:03
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.

BUG in Gamma API /events's closed param which default to true while doc says false (propagates to CLI)

1 participant