Repository navigation
Manage idling when connected via Codex Desktop via codex API (CRW-126… - #393
Merged
Merged
Conversation
…26) (#390) Extends CLI Watcher with a pluggable ActivitySource architecture and a new codex-app-server source, so workspaces stay alive while a user is actively working through Codex Desktop / the Codex VS Code extension / any other codex app-server client - not just via a TTY-attached shell. - ActivitySource interface + admin-controlled source selection (CLI_ACTIVITY_TRACKER_ACTIVITY_SOURCES), with the existing TTY-based detection unchanged as the tty source (on by default). - New codex-app-server source (opt-in): connects to a running codex app-server's own JSON-RPC control socket and polls thread/loaded/list + thread/read, gating activity on how recently the most-recently-updated loaded thread's updatedAt timestamp was touched. Only requires that the app-server's --listen unix://... socket is reachable, found via /proc comm+cmdline discovery (codex_app_server_discovery.go). Falls back to resolving the daemon-assigned default socket path (${CODEX_HOME:-$HOME/.codex}/app-server-control/app-server-control.sock) via the target process's own environment when codex was started with a bare --listen unix:// (no explicit path) - Gates activity on updatedAt freshness rather than the thread's status field. Does not honor gracePeriod/maxProcessAge. - The JSON-RPC client sets both read and write deadlines (5s) so a hung app-server cannot stall the watcher's scan loop; a transport-level thread/read failure drops the cached connection and stops the scan (next tick dials fresh), while JSON-RPC error responses (e.g. a thread that just disappeared) are logged and the scan continues. - Logs the full scan reasoning at verbose level - loaded-thread IDs, each thread's status/activeFlags/updatedAt as it's checked, per-thread read failures, and the freshness decision either way - so an admin can tell the source is actually reaching the app-server, not just whether it found something. - Covers the decision logic with unit tests and integration-style tests against a fake codex app-server served over a real Unix socket. Adds a protocol-compatibility test that runs against whatever codex CLI is actually installed (skipped if none is found) and checks that the Thread/ThreadStatus schema and the method names this client depends on still match, so a future codex protocol change fails this test loudly instead of breaking detection silently at runtime. Enable with CLI_ACTIVITY_TRACKER_ACTIVITY_SOURCES=tty,codex-app-server (or just codex-app-server, since tty stays on by default unless explicitly disabled) on the workspace container. See CLI-WATCHER.md's new "Activity Sources" section for the full syntax and admin/.noidle split. Issue: https://redhat.atlassian.net/browse/CRW-12626 Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Assisted-By: OpenCode: MiMo-V2.6-Flash Free Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com> Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…26) (#390)
Extends CLI Watcher with a pluggable ActivitySource architecture and a new codex-app-server source, so workspaces stay alive while a user is actively working through Codex Desktop / the Codex VS Code extension / any other codex app-server client - not just via a TTY-attached shell.
Enable with CLI_ACTIVITY_TRACKER_ACTIVITY_SOURCES=tty,codex-app-server (or just codex-app-server, since tty stays on by default unless explicitly disabled) on the workspace container. See CLI-WATCHER.md's new "Activity Sources" section for the full syntax and admin/.noidle split.
Issue: https://redhat.atlassian.net/browse/CRW-12626
Assisted-By: Claude Sonnet 5 noreply@anthropic.com
Assisted-By: OpenCode: MiMo-V2.6-Flash Free
Reviewed-by: Roland Grunberg rgrunber@redhat.com