From c25bb2870c01e6b8123589ca58c34cc3045279c1 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Mon, 3 Aug 2026 10:43:09 +0200 Subject: [PATCH] gui: remove dead createSession method --- gui/ollie9pclient.cpp | 66 ------------------------------------------- gui/ollie9pclient.h | 1 - 2 files changed, 67 deletions(-) diff --git a/gui/ollie9pclient.cpp b/gui/ollie9pclient.cpp index 48a633c..ea39c56 100644 --- a/gui/ollie9pclient.cpp +++ b/gui/ollie9pclient.cpp @@ -493,72 +493,6 @@ QStringList Ollie9pClient::getAvailableModels(const QString &backend) const return it.value().toStringList(); } -bool Ollie9pClient::createSession(const QString &cwd, const QString &name, const QString &backend, const QString &model, const QString &agent, const QString &remote, const QString &agentAlias) -{ - if (cwd.isEmpty()) return false; - - // Step 1: Create the session (name only) using rdwr (write then read back result) - QString sessName = name; - { - QProcess proc; - QStringList args = {"-a", serverAddr(), "rdwr", "session/new"}; - proc.start(ninepBin(), args); - proc.waitForStarted(3000); - QString input = "name=" + sessName + "\n"; - proc.write(input.toUtf8()); - proc.closeWriteChannel(); - proc.waitForFinished(5000); - if (proc.exitCode() != 0) { - QString err = QString::fromUtf8(proc.readAllStandardError()).trimmed(); - if (err.isEmpty()) - err = QString::fromUtf8(proc.readAllStandardOutput()).trimmed(); - qDebug() << "createSession (step 1) failed:" << err; - return false; - } - // Read the returned session name (auto-generated if blank) - QByteArray out = proc.readAllStandardOutput().trimmed(); - if (!out.isEmpty()) - sessName = QString::fromUtf8(out); - } - - // Step 2: Create the agent within the session using rdwr - { - QStringList agentArgs; - agentArgs << "cwd=" + cwd; - if (!backend.isEmpty()) agentArgs << "backend=" + backend; - if (!model.isEmpty()) agentArgs << "model=" + model; - if (!agent.isEmpty()) agentArgs << "agent=" + agent; - if (!remote.isEmpty()) agentArgs << "remote=" + remote; - if (!agentAlias.isEmpty()) agentArgs << "name=" + agentAlias; - - QProcess proc; - QStringList args = {"-a", serverAddr(), "rdwr", "session/" + sessName + "/agent/new"}; - proc.start(ninepBin(), args); - proc.waitForStarted(3000); - QString input = agentArgs.join(" ") + "\n"; - proc.write(input.toUtf8()); - proc.closeWriteChannel(); - proc.waitForFinished(5000); - - if (proc.exitCode() != 0) { - QString err = QString::fromUtf8(proc.readAllStandardError()).trimmed(); - if (err.isEmpty()) - err = QString::fromUtf8(proc.readAllStandardOutput()).trimmed(); - qDebug() << "createSession (step 2) failed:" << err; - // Clean up the session - QProcess killProc; - killProc.start(ninepBin(), {"-a", serverAddr(), "write", "session/" + sessName + "/ctl"}); - killProc.waitForStarted(3000); - killProc.write("kill"); - killProc.closeWriteChannel(); - killProc.waitForFinished(3000); - return false; - } - } - - return true; -} - bool Ollie9pClient::createQuickSession() { QProcess proc; diff --git a/gui/ollie9pclient.h b/gui/ollie9pclient.h index 0eab892..cc0f85e 100644 --- a/gui/ollie9pclient.h +++ b/gui/ollie9pclient.h @@ -84,7 +84,6 @@ public: Q_INVOKABLE void loadRootBackends(); Q_INVOKABLE void loadRootAgents(); Q_INVOKABLE QStringList getAvailableModels(const QString &backend) const; - Q_INVOKABLE bool createSession(const QString &cwd, const QString &name, const QString &backend, const QString &model, const QString &agent, const QString &remote, const QString &agentAlias); Q_INVOKABLE bool createQuickSession(); Q_INVOKABLE QString createAgent(const QString &sessionId, const QString &cwd, const QString &backend, const QString &model, const QString &agent, const QString &remote, const QString &agentAlias); Q_INVOKABLE bool killAgent(const QString &sessionId, const QString &agentId);