Skip to content

Add app-server current-time impl (3/n)#28835

Merged
rka-oai merged 15 commits into
mainfrom
codex/current-time-app-server-provider
Jun 18, 2026
Merged

Add app-server current-time impl (3/n)#28835
rka-oai merged 15 commits into
mainfrom
codex/current-time-app-server-provider

Conversation

@rka-oai

@rka-oai rka-oai commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

Server should request:

{
  "id": 42,
  "method": "currentTime/read",
  "params": {
    "threadId": "11111111-1111-1111-1111-aaaaafdc2c11"
  }
}

Client should respond with something like:

{
  "id": 42,
  "result": {
    "currentTimeAt": 1781717655
  }
}

Why

Sessions configured with clock_source = "external" need a thread-specific external time source before inference. The system clock remains the default production provider.

Validation

  • cargo test -p codex-app-server-protocol
  • cargo test -p codex-app-server --test all current_time_read_round_trip_adds_reminder_to_model_input
  • cargo test -p codex-app-server first_attestation_capable_connection_for_thread_only_uses_thread_subscribers
  • cargo test -p codex-analytics
  • just fix -p codex-app-server-protocol
  • just fix -p codex-app-server

Stacked on #28824.

@rka-oai rka-oai marked this pull request as ready for review June 18, 2026 03:22
@rka-oai rka-oai changed the title Add app-server current-time provider Add app-server current-time impl (varlatency 3/n) Jun 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d473fdc80a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/app-server/src/current_time.rs Outdated
Comment thread codex-rs/app-server-protocol/src/protocol/v1.rs Outdated
Comment thread codex-rs/app-server-protocol/src/protocol/v2/current_time.rs
Comment thread codex-rs/app-server/src/current_time.rs Outdated
thread_id: ThreadId,
) -> Result<DateTime<Utc>> {
let connection_ids = thread_state_manager
.current_time_capable_connections_for_thread(thread_id)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wait for subscriber attachment before reading app-server time

For threads created outside the synchronous thread/start path, such as subagents, client subscription is attached later by the thread_created_rx background branch, but the first model request can call this provider immediately. With clock_source = "app_server_client" and a reminder due on the first request, this lookup can see zero current-time-capable subscribers and fail the turn even though an initialized client would be attached moments later; make creation/attachment ordered for these threads or have the provider wait/retry for the initial subscriber.

Useful? React with 👍 / 👎.

@rka-oai rka-oai Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed cleanly for the supported single-client case in 5617874.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a real problem? how can a thread be started without a client?

Comment thread codex-rs/app-server-protocol/src/protocol/v1.rs Outdated
Comment thread codex-rs/app-server-client/src/lib.rs Outdated
@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from e8c21f1 to 3e4d0c9 Compare June 18, 2026 11:39
@rka-oai rka-oai requested a review from a team as a code owner June 18, 2026 11:39
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from 2c669b3 to 57c2e3a Compare June 18, 2026 11:40
@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from 3e4d0c9 to 38a6d16 Compare June 18, 2026 11:46
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from 57c2e3a to 6dbca65 Compare June 18, 2026 11:46
@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from 38a6d16 to d45f58b Compare June 18, 2026 11:55
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from 6dbca65 to c5f8cf9 Compare June 18, 2026 11:56
@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from d45f58b to 4d678ec Compare June 18, 2026 12:40
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from c5f8cf9 to 92e446b Compare June 18, 2026 12:40
@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from 4d678ec to f09e32e Compare June 18, 2026 12:47
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch 4 times, most recently from cc336fc to 8bb2652 Compare June 18, 2026 16:08
@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from 14e4299 to 0539ddc Compare June 18, 2026 16:14
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from 8bb2652 to 272f0ae Compare June 18, 2026 16:14
Comment thread codex-rs/app-server/src/request_processors/initialize_processor.rs Outdated
}

#[tokio::test]
async fn wait_for_thread_subscriber_unblocks_after_connection_attaches() -> Result<()> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is see how it is related

@pakrym-oai pakrym-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we simplify and drop capability

@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from 0539ddc to 671d4f5 Compare June 18, 2026 17:19
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from 1e18383 to a24c554 Compare June 18, 2026 17:20
},

/// Read the current time from an external clock owned by the client.
CurrentTimeRead => "currentTime/read" {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we mark experimental?

@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from 671d4f5 to 933b6ab Compare June 18, 2026 18:07
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from 9b945b9 to 55871a2 Compare June 18, 2026 18:08
@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from 933b6ab to 5396ac2 Compare June 18, 2026 18:55
@rka-oai rka-oai force-pushed the codex/varlatency-reminders branch from 5396ac2 to ba927fa Compare June 18, 2026 18:57
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from 4b6b95c to deff2c0 Compare June 18, 2026 19:06
Base automatically changed from codex/varlatency-reminders to main June 18, 2026 19:18
@rka-oai rka-oai force-pushed the codex/current-time-app-server-provider branch from deff2c0 to 9280920 Compare June 18, 2026 19:37
@rka-oai rka-oai merged commit f4602b7 into main Jun 18, 2026
31 checks passed
@rka-oai rka-oai deleted the codex/current-time-app-server-provider branch June 18, 2026 20:12
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 18, 2026
@rka-oai rka-oai changed the title Add app-server current-time impl (varlatency 3/n) Add app-server current-time impl (3/n) Jun 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants