Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ codex app-server

CodexUI connects automatically to the local `codex-backend` Unix frontend
socket through Qt and delegates authentication, protocol handling, and state
synchronization to AISuite's public frontend SDK. The sidebar and selected
thread identity display synchronized live state. Detailed conversation,
activity, agent, inspector, and composer content remains deterministic
presentation data for now.
synchronization to AISuite's public frontend SDK. The sidebar displays real
synchronized threads, and the center work area renders the selected thread's
real turns, messages, semantic items, activity, token usage, and failures from
the current immutable frontend State.

CodexUI remains read-only. Composer actions, thread actions, approvals, and
interrupt/stop are not connected. The right inspector still contains
presentation/demo content.

## Build

Expand Down
20 changes: 20 additions & 0 deletions src/app/FrontendSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "app/FrontendSession.h"

#include <ai/openai/codex/frontend/Security.h>
#include <ai/openai/codex/frontend/client/Threads.h>

#include <QByteArray>
#include <QDir>
Expand Down Expand Up @@ -131,6 +132,25 @@ const sdk::State& FrontendSession::state() const noexcept
return currentState;
}

void FrontendSession::loadThread(const QString& threadId)
{
if (currentLifecycle != Lifecycle::Ready || threadId.isEmpty())
return;
const std::string id = threadId.toStdString();
const auto* thread = currentState.thread(id);
if (!thread || thread->fullyLoaded || requestedThreadReads.contains(id))
return;

requestedThreadReads.insert(id);
sdk::Submission submission = client->threads().read(
{ai::openai::codex::typed::ThreadId{id}, true},
[this, id](const sdk::OperationResult<sdk::ThreadReadResult>&) {
requestedThreadReads.erase(id);
});
if (!submission)
requestedThreadReads.erase(id);
}

QString FrontendSession::defaultSocketPath()
{
const QString runtimeDirectory = qEnvironmentVariable("XDG_RUNTIME_DIR");
Expand Down
3 changes: 3 additions & 0 deletions src/app/FrontendSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <ai/openai/codex/frontend/client/Client.h>

#include <memory>
#include <set>
#include <string>

namespace codexui {
Expand All @@ -28,6 +29,7 @@ class FrontendSession : public QObject
[[nodiscard]] Lifecycle lifecycle() const noexcept;
[[nodiscard]] QString statusText() const;
[[nodiscard]] const ai::openai::codex::frontend::client::State& state() const noexcept;
void loadThread(const QString& threadId);

signals:
void lifecycleChanged();
Expand All @@ -54,6 +56,7 @@ class FrontendSession : public QObject
ai::openai::codex::frontend::client::State currentState;
Lifecycle currentLifecycle = Lifecycle::Disconnected;
QString detail;
std::set<std::string> requestedThreadReads;
bool localShutdown = false;
};

Expand Down
Loading