Skip to content

feat(java): complete Forward fields and add client extensions - #5

Merged
moonyue-w merged 2 commits into
mainfrom
codex/java-client-extensions
Oct 22, 2026
Merged

moonyue-w merged 2 commits into
mainfrom
codex/java-client-extensions

Conversation

@moonyue-w

@moonyue-w moonyue-w commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Change

Java applications currently need raw JSON fields for several Forward properties and cannot supply their own HTTP implementation, wrap API attempts for tracing, call additional JSON endpoints, or derive a client with adjusted settings. This change adds those public extension points while retaining the existing authentication, retry, error and streaming behavior.

  • Complete typed Forward parity with Go a996a88, Python 2f8c625 and TypeScript f4e3a4f: image file_id, creation-time Memory Store mount access, Schedule/Run initial_events_version, and Pairing created_at / updated_at. Missing versions remain nullable rather than becoming zero. The operation inventory remains 123 entries; see docs/forward-api-coverage.md.
  • Add caller-owned HttpTransport and per-attempt HttpInterceptor contracts using Java 8 public types. Cancellation reaches downstream futures, response bodies remain streaming, and failed/replaced interceptor responses are closed before retry. Signed-URL storage downloads use the custom transport without API credentials or interceptors.
  • Add synchronous/asynchronous request(ApiRequest, RequestOptions) for relative JSON endpoints and withOptions(...) for independently closeable client copies. Copies retain resolved authentication and unspecified settings; injected credentials and transports remain caller-owned.
  • Document the APIs and their scope, add a runnable example and an independent JAR consumer using HttpURLConnection, and update the Unreleased changelog.

This is Java-specific; Go, Python and TypeScript code is unchanged. Existing default clients continue to use OkHttp. Realtime WebSockets and ServiceAccountCredential platform token exchange keep their existing transports. Generic JSON requests do not add resource-specific validation; typed methods remain preferred where available. No version bump or publishing is included.

Validation

  • SDK build, tests and Javadoc pass.
  • Independent examples consume the installed JAR and pass.
  • Java 8 package checks pass; changed runtime behavior is checked on Java 8, 11, 17, 21 and 25.
  • Documentation and changelog reflect public behavior changes.
  • make quality passes on JDK 17: formatting, repository/link checks and 38 maintenance tests.
  • Version change: not applicable; both POMs retain 0.1.0, with additions documented as unreleased.

For each JDK 8 / 11 / 17 / 21 / 25, ran:

./mvnw -B -ntp -Dmaven.repo.local=<isolated-cache> clean install
./mvnw -B -ntp -Dmaven.repo.local=<isolated-cache> -f examples/pom.xml clean verify
python3 .github/scripts/check_package.py

Each JDK passed 567 SDK tests and 63 independent consumer tests, with zero failures, errors or skips (3,150 test executions across the matrix). Package checks cover the main, sources and Javadoc JARs and Java 8 bytecode. Also ran git diff --check.

Regression coverage includes authentication/metadata, retry and idempotency rules, SSE resumption, cancellation through interceptor futures, header timeout, late response cleanup, isolated storage downloads, SAT management, client-copy ownership, and response replacement/failure cleanup. The two cleanup regression tests failed before their fix and passed afterward.

The five-JDK local matrix used source bc1f1706c2969d70148f8365e58794257809b569. Follow-up 5bbdf48bbf1681dba082c659bd471a3cec78069a changes only cancellation tests to await explicit completion signals instead of depending on callback-registration timing; all 20 extension tests were rerun successfully on Java 8 and 17. The final PR CI run passed quality and all five complete JDK jobs on this head. The push-triggered CI run also passed all six jobs.

Validation uses local mock services and packaged JARs. No live CN/Global scenarios were run in this change; these results are not production compatibility or human QA approval.

@moonyue-w
moonyue-w merged commit d93dbf9 into main Oct 22, 2026
12 checks passed
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