@clagentic/console 1.3.1-beta.1 → 1.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -901,9 +901,9 @@ function attachLoop(ctx) {
901
901
  loopState.phase = "crafting";
902
902
  saveLoopState();
903
903
 
904
- var judgeCraftPrompt = "Use the /clay-ralph skill to design ONLY a JUDGE.md for an existing Ralph Loop. " +
904
+ var judgeCraftPrompt = "Use the /ralph-loop skill to design ONLY a JUDGE.md for an existing Ralph Loop. " +
905
905
  "The user has already provided PROMPT.md, so do NOT create or modify PROMPT.md. " +
906
- "You MUST invoke the clay-ralph skill — do NOT execute the task yourself. " +
906
+ "You MUST invoke the ralph-loop skill — do NOT execute the task yourself. " +
907
907
  "Your job is to read the existing PROMPT.md and create a JUDGE.md " +
908
908
  "that will evaluate whether the coder session completed the task successfully.\n\n" +
909
909
  "## Task\n" + (wData.task || "") +
@@ -944,26 +944,26 @@ function attachLoop(ctx) {
944
944
  return true;
945
945
  }
946
946
 
947
- // Default: "draft" mode — crafts files via the clay-ralph skill
947
+ // Default: "draft" mode — crafts files via the ralph-loop skill
948
948
  var _draftIsSimple = wData.loopMode === "simple";
949
949
  var craftingPrompt;
950
950
  if (_draftIsSimple) {
951
- craftingPrompt = "Use the /clay-ralph skill to design a Ralph Loop for the following task. " +
952
- "You MUST invoke the clay-ralph skill — do NOT execute the task yourself. " +
951
+ craftingPrompt = "Use the /ralph-loop skill to design a Ralph Loop for the following task. " +
952
+ "You MUST invoke the ralph-loop skill — do NOT execute the task yourself. " +
953
953
  "This is a Simple Loop (no judge). Your job is to create ONLY a PROMPT.md file " +
954
954
  "that a future autonomous session will execute. Do NOT create a JUDGE.md file.\n\n" +
955
955
  "## Task\n" + (wData.task || "") +
956
956
  "\n\n## Loop Directory\n" + lDir;
957
957
  } else if (wData.judgeAuthor === "me") {
958
- craftingPrompt = "Use the /clay-ralph skill to design a Ralph Loop for the following task. " +
959
- "You MUST invoke the clay-ralph skill — do NOT execute the task yourself. " +
958
+ craftingPrompt = "Use the /ralph-loop skill to design a Ralph Loop for the following task. " +
959
+ "You MUST invoke the ralph-loop skill — do NOT execute the task yourself. " +
960
960
  "The user will provide their own JUDGE.md, so create ONLY a PROMPT.md file " +
961
961
  "that a future autonomous session will execute. Do NOT create a JUDGE.md file.\n\n" +
962
962
  "## Task\n" + (wData.task || "") +
963
963
  "\n\n## Loop Directory\n" + lDir;
964
964
  } else {
965
- craftingPrompt = "Use the /clay-ralph skill to design a Ralph Loop for the following task. " +
966
- "You MUST invoke the clay-ralph skill — do NOT execute the task yourself. " +
965
+ craftingPrompt = "Use the /ralph-loop skill to design a Ralph Loop for the following task. " +
966
+ "You MUST invoke the ralph-loop skill — do NOT execute the task yourself. " +
967
967
  "Your job is to interview me, then create PROMPT.md and JUDGE.md files " +
968
968
  "that a future autonomous session will execute.\n\n" +
969
969
  "## Task\n" + (wData.task || "") +
@@ -15,7 +15,10 @@ agentsModule.refresh().catch(function (e) {
15
15
 
16
16
  // Format a user's answer to an ask_user_questions card as a plain user
17
17
  // message so the MCP path can feed it back to the agent on the next turn.
18
- // The agent sees: its own question text, then the selected answer(s).
18
+ // Always use "- Q → A" form and prefix with a header so the model can
19
+ // connect the answer to its earlier AskUserQuestion call even across a
20
+ // turn break. A bare answer with no context reads as a non-sequitur and
21
+ // triggers "I don't see an answer" responses from the model.
19
22
  function formatAskUserAnswerAsMessage(input, answers) {
20
23
  var questions = (input && Array.isArray(input.questions)) ? input.questions : [];
21
24
  if (questions.length === 0) {
@@ -29,15 +32,12 @@ function formatAskUserAnswerAsMessage(input, answers) {
29
32
  var qText = (q && q.question) ? q.question : ("Question " + (i + 1));
30
33
  var ans = (answers && answers[i] != null) ? String(answers[i]) : "";
31
34
  if (!ans) continue;
32
- if (questions.length === 1) {
33
- // Single question: keep it tight.
34
- lines.push(ans);
35
- } else {
36
- lines.push("- " + qText + " → " + ans);
37
- }
35
+ lines.push("- " + qText + " → " + ans);
38
36
  }
39
37
  if (lines.length === 0) return "(no answer provided)";
40
- return lines.join("\n");
38
+ // Prefix tells the model this is a structured answer to its previous
39
+ // AskUserQuestion call — unambiguous even when read out of turn context.
40
+ return "[Answer to your AskUserQuestion]\n" + lines.join("\n");
41
41
  }
42
42
 
43
43
  /**
@@ -441,6 +441,20 @@
441
441
  .hub-recent-item:hover {
442
442
  background: rgba(var(--overlay-rgb), 0.06);
443
443
  }
444
+ .hub-recent-dot {
445
+ width: 7px;
446
+ height: 7px;
447
+ border-radius: 50%;
448
+ flex-shrink: 0;
449
+ background: var(--text-dimmer);
450
+ opacity: 0.35;
451
+ transition: background 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
452
+ }
453
+ .hub-recent-dot.processing {
454
+ background: var(--success);
455
+ opacity: 1;
456
+ box-shadow: 0 0 6px rgba(80, 250, 123, 0.4);
457
+ }
444
458
  .hub-recent-project-icon {
445
459
  font-size: 14px;
446
460
  width: 20px;
@@ -198,6 +198,11 @@ export function connect() {
198
198
  closeDmUserPicker();
199
199
  setStatus("disconnected");
200
200
  setActivity(null);
201
+ // lr-0446: Discard any pending cross-project session switch. If the WS
202
+ // closed before the target project's session_list fired, the key is now
203
+ // stale — leaving it would cause the *next* successful session_list (on
204
+ // any project reconnect) to switch to a wrong session.
205
+ try { sessionStorage.removeItem("pending-hub-session"); } catch (e) {}
201
206
  scheduleReconnect();
202
207
  };
203
208
 
@@ -423,7 +423,9 @@ export function handleHubRecentSessions(msg) {
423
423
  var agentBadge = sess.agentName
424
424
  ? '<span class="hub-recent-agent">' + escapeHtml(sess.agentName) + '</span>'
425
425
  : '';
426
+ var dotClass = "hub-recent-dot" + (sess.isProcessing ? " processing" : "");
426
427
  item.innerHTML =
428
+ '<span class="' + dotClass + '"></span>' +
427
429
  iconHtml +
428
430
  '<span class="hub-recent-title">' + escapeHtml(sess.title) + '</span>' +
429
431
  agentBadge +
@@ -120,7 +120,7 @@ function requireClayRalph(cb) {
120
120
  requireSkills({
121
121
  title: "Skill Installation Required",
122
122
  reason: "This feature requires the following skill to be installed.",
123
- skills: [{ name: "clay-ralph", scope: "global" }]
123
+ skills: [{ name: "ralph-loop", scope: "global" }]
124
124
  }, cb);
125
125
  }
126
126
 
@@ -109,6 +109,7 @@ var CODEX_WEBSEARCH_OPTIONS = [
109
109
  var KNOWN_CONTEXT_WINDOWS = {
110
110
  "opus-4-6": 1000000,
111
111
  "claude-sonnet-4": 1000000,
112
+ "gpt-5.5": 1048576,
112
113
  "gpt-5.4": 1048576,
113
114
  "gpt-5.3": 1048576,
114
115
  "gpt-5.2": 1048576,
@@ -27,7 +27,8 @@ export var MODEL_DESCRIPTIONS = {
27
27
  "haiku": "Fastest model. Best for quick tasks and simple questions.",
28
28
  "opus": "Most powerful model. Best for complex reasoning and analysis.",
29
29
  // Codex/OpenAI families
30
- "gpt-5.4": "Latest GPT-5.4. Highest capability and reasoning.",
30
+ "gpt-5.5": "Latest GPT-5.5. Frontier model for complex coding and agentic workflows.",
31
+ "gpt-5.4": "GPT-5.4. Strong reasoning and agentic coding.",
31
32
  "gpt-5.4-mini": "Faster, lighter GPT-5.4 variant. Great for most coding tasks.",
32
33
  "gpt-5.3-codex": "GPT-5.3 Codex. Strong at agentic coding and tool use.",
33
34
  "gpt-5.3-codex-spark": "Lean GPT-5.3 Codex. Optimized for speed.",
package/lib/scheduler.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Loop Registry — unified storage for all Ralph Loops (one-off + scheduled).
3
3
  *
4
4
  * Stores loop records in ~/.clay/loops/{encodedCwd}.jsonl
5
- * Each record represents a job defined via clay-ralph (PROMPT.md + JUDGE.md).
5
+ * Each record represents a job defined via ralph-loop (PROMPT.md + JUDGE.md).
6
6
  * Records with a `cron` field are checked every 30s and auto-triggered.
7
7
  * Records without cron are one-off (standard Ralph Loop behavior).
8
8
  */
package/lib/sdk-bridge.js CHANGED
@@ -940,7 +940,19 @@ function createSDKBridge(opts) {
940
940
  }
941
941
  session.taskStopRequested = false;
942
942
  session.pendingPermissions = {};
943
- session.pendingAskUser = {};
943
+ // Preserve MCP-mode AskUserQuestion entries across turn boundaries.
944
+ // The MCP path is intentionally stateless: ask_user returns immediately
945
+ // ("card posted, end your turn") and the answer arrives as a new
946
+ // user_message on the next turn. Those entries MUST survive this finally
947
+ // block so ask_user_response can find the toolId and inject the answer.
948
+ // canUseTool-mode entries hold an open SDK callback that dies with the
949
+ // query anyway, so those are correctly cleared here.
950
+ var _keepAskUser = {};
951
+ for (var _tid in session.pendingAskUser) {
952
+ var _pau = session.pendingAskUser[_tid];
953
+ if (_pau && _pau.mode === "mcp") _keepAskUser[_tid] = _pau;
954
+ }
955
+ session.pendingAskUser = _keepAskUser;
944
956
  session.pendingElicitations = {};
945
957
 
946
958
  // Auto-continue on rate limit (scheduler sessions, or user setting)
package/lib/server.js CHANGED
@@ -957,7 +957,7 @@ function createServer(opts) {
957
957
  var projectTitle = status.title || status.project || pSlug;
958
958
  var projectIcon = status.icon || null;
959
959
  pSm.sessions.forEach(function (s) {
960
- if (!s.hidden && s.history && s.history.length > 0) {
960
+ if (!s.hidden) {
961
961
  // Push a shallow copy annotated with project metadata rather than
962
962
  // mutating the live session object with transient UI fields.
963
963
  allSessions.push(Object.assign({}, s, {
@@ -586,7 +586,7 @@ function createCodexQueryHandle(appServer, queryOpts) {
586
586
  done: false,
587
587
  aborted: false,
588
588
  loopStarted: false,
589
- model: queryOpts.model || "gpt-5.4",
589
+ model: queryOpts.model || _defaultModel,
590
590
  // Track incremental text deltas
591
591
  textBlocks: {}, // itemId -> true (text_start sent)
592
592
  textLengths: {}, // itemId -> last sent length
@@ -834,7 +834,7 @@ function createCodexQueryHandle(appServer, queryOpts) {
834
834
  try {
835
835
  // Start or resume thread
836
836
  var threadParams = {
837
- model: queryOpts.model || "gpt-5.4",
837
+ model: queryOpts.model || _defaultModel,
838
838
  sandbox: queryOpts.sandboxMode || "workspace-write",
839
839
  approvalPolicy: queryOpts.approvalPolicy || "on-failure",
840
840
  cwd: queryOpts.cwd,
@@ -1065,6 +1065,13 @@ var CODEX_EFFORT_LEVELS = ["minimal", "low", "medium", "high", "xhigh"];
1065
1065
  var CODEX_EFFORT_LEVELS_STANDARD = ["low", "medium", "high"]; // models without xhigh/minimal
1066
1066
 
1067
1067
  var CODEX_DEFAULT_MODELS = [
1068
+ {
1069
+ value: "gpt-5.5",
1070
+ displayName: "GPT-5.5",
1071
+ supportsEffort: true,
1072
+ supportedEffortLevels: CODEX_EFFORT_LEVELS,
1073
+ supportsThinking: false,
1074
+ },
1068
1075
  {
1069
1076
  value: "gpt-5.4",
1070
1077
  displayName: "GPT-5.4",
@@ -1109,6 +1116,7 @@ function createCodexAdapter(opts) {
1109
1116
  var _slug = (opts && opts.slug) || "";
1110
1117
  var _defaultInitOpts = Object.assign({}, opts || {});
1111
1118
  var _cachedModels = [];
1119
+ var _defaultModel = "gpt-5.5";
1112
1120
  var _appServer = null;
1113
1121
  var _initPromise = null;
1114
1122
  var _shutdownPromise = null;
@@ -1146,7 +1154,7 @@ function createCodexAdapter(opts) {
1146
1154
  function buildReadyResponse(skillNames) {
1147
1155
  return {
1148
1156
  models: _cachedModels,
1149
- defaultModel: "gpt-5.4",
1157
+ defaultModel: _defaultModel,
1150
1158
  skills: skillNames || [],
1151
1159
  slashCommands: skillNames || [],
1152
1160
  fastModeState: null,
@@ -1358,9 +1366,47 @@ function createCodexAdapter(opts) {
1358
1366
  throw createShutdownError();
1359
1367
  }
1360
1368
 
1361
- // Use curated default model list. CODEX_DEFAULT_MODELS entries are already
1362
- // rich descriptor objects with capability flags; no further enrichment needed.
1363
- _cachedModels = CODEX_DEFAULT_MODELS.slice();
1369
+ // Query the app-server for the live model list. The v2 protocol exposes
1370
+ // "model/list" which returns rich Model objects with displayName, isDefault,
1371
+ // supportedReasoningEfforts, and upgrade (non-null when a newer model exists).
1372
+ // Fall back to CODEX_DEFAULT_MODELS if the call fails or returns nothing.
1373
+ try {
1374
+ var modelListResult = await _appServer.send("model/list", {}, 10000);
1375
+ // Response shape: { data: [Model, ...], nextCursor }
1376
+ if (modelListResult && Array.isArray(modelListResult.data) && modelListResult.data.length > 0) {
1377
+ _cachedModels = modelListResult.data
1378
+ .filter(function(m) { return !m.hidden; })
1379
+ .map(function(m) {
1380
+ var efforts = Array.isArray(m.supportedReasoningEfforts)
1381
+ ? m.supportedReasoningEfforts.map(function(r) { return r.reasoningEffort; })
1382
+ : CODEX_EFFORT_LEVELS;
1383
+ return {
1384
+ value: m.model || m.id,
1385
+ displayName: m.displayName || m.model || m.id,
1386
+ supportsEffort: efforts.length > 0,
1387
+ supportedEffortLevels: efforts,
1388
+ supportsThinking: false,
1389
+ isLatest: !m.upgrade,
1390
+ };
1391
+ });
1392
+ // Derive default model: first isDefault entry, or first non-hidden entry
1393
+ var defaultEntry = null;
1394
+ for (var mi = 0; mi < modelListResult.data.length; mi++) {
1395
+ if (!modelListResult.data[mi].hidden && modelListResult.data[mi].isDefault) {
1396
+ defaultEntry = modelListResult.data[mi];
1397
+ break;
1398
+ }
1399
+ }
1400
+ _defaultModel = (defaultEntry && (defaultEntry.model || defaultEntry.id)) || _defaultModel;
1401
+ console.log("[codex] model/list: " + _cachedModels.length + " models, default=" + _defaultModel);
1402
+ } else {
1403
+ throw new Error("empty or missing data");
1404
+ }
1405
+ } catch (e) {
1406
+ console.warn("[codex] model/list failed (" + e.message + "); using built-in model table");
1407
+ _cachedModels = CODEX_DEFAULT_MODELS.slice();
1408
+ // _defaultModel stays "gpt-5.5" (set at init)
1409
+ }
1364
1410
  console.log("[codex] App-server initialized, models: " + _cachedModels.map(function(m) { return m.value; }).join(", "));
1365
1411
 
1366
1412
  // Discover skills: built-in Codex skills + Claude skills
@@ -1443,7 +1489,7 @@ function createCodexAdapter(opts) {
1443
1489
  throw new Error("[yoke/codex] Adapter not initialized. Call init() first.");
1444
1490
  }
1445
1491
 
1446
- var model = queryOpts.model || "gpt-5.4";
1492
+ var model = queryOpts.model || _defaultModel;
1447
1493
  var ac = queryOpts.abortController || new AbortController();
1448
1494
  var activeEntry = {
1449
1495
  abort: function() {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.3.1-beta.1",
6
+ "version": "1.4.0-beta.1",
7
7
  "description": "Self-hosted console for Claude Code and Codex. Multi-user, browser-based, persistent AI sessions.",
8
8
  "bin": {
9
9
  "clagentic-console": "./bin/cli.js"