colana 1.0.0-beta.44 → 1.0.0-beta.45

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colana",
3
- "version": "1.0.0-beta.44",
3
+ "version": "1.0.0-beta.45",
4
4
  "description": "Agent-First. Multiplied. Multi-agent command center for AI coding agents.",
5
5
  "type": "module",
6
6
  "main": "server/index.js",
package/public/app.js CHANGED
@@ -1555,12 +1555,24 @@ async function sendPersonalChatMessage() {
1555
1555
  restartBtn.disabled = true;
1556
1556
  restartBtn.textContent = 'Restarting...';
1557
1557
  try {
1558
- await fetch('/api/personal-agent/restart-gateway', {
1558
+ const res = await fetch('/api/personal-agent/restart-gateway', {
1559
1559
  method: 'POST',
1560
1560
  headers: getAuthHeaders(),
1561
1561
  });
1562
- restartBtn.textContent = 'Restarted — try again';
1563
- showToast('Gateway restarted. Try sending your message again.', 'success');
1562
+ if (!res.ok) throw new Error('Restart failed');
1563
+ restartBtn.textContent = 'Restarted retrying...';
1564
+ // Auto-retry: find the last user message and resend
1565
+ const pa = state.personalAgent;
1566
+ const lastUserMsg = [...pa.chatMessages].reverse().find(m => m.role === 'user');
1567
+ if (lastUserMsg) {
1568
+ // Set the input to the last message and trigger send
1569
+ const textarea = document.getElementById('personal-panel-input');
1570
+ if (textarea) textarea.value = lastUserMsg.content;
1571
+ // Small delay so gateway has time to fully initialize
1572
+ setTimeout(() => sendPersonalChatMessage(), 1500);
1573
+ } else {
1574
+ showToast('Gateway restarted. Try sending your message again.', 'success');
1575
+ }
1564
1576
  } catch {
1565
1577
  restartBtn.textContent = 'Restart Failed';
1566
1578
  showToast('Gateway restart failed. Open Settings to troubleshoot.', 'error');
@@ -100,7 +100,7 @@ export function registerPersonalAgentRoutes(app, { sensitiveLimiter }) {
100
100
  if (authToken) {
101
101
  headers['Authorization'] = `Bearer ${authToken}`;
102
102
  } else {
103
- // Gateway auth token not found the gateway will reject with 401.
103
+ // Fail fast: don't send a request we know will get 401'd.
104
104
  // Log config state for diagnosis on fresh installs.
105
105
  const cfg = getOpenClawConfig();
106
106
  const hasConfig = !!cfg;
@@ -108,6 +108,12 @@ export function registerPersonalAgentRoutes(app, { sensitiveLimiter }) {
108
108
  const hasAuth = !!cfg?.gateway?.auth;
109
109
  const authMode = cfg?.gateway?.auth?.mode || 'none';
110
110
  console.warn(`[personal-agent] No gateway auth token found — config:${hasConfig} gateway:${hasGateway} auth:${hasAuth} mode:${authMode}`);
111
+ return res.status(401).json({
112
+ error: 'Gateway authentication token not found in OpenClaw config.',
113
+ code: 'GATEWAY_TOKEN_MISSING',
114
+ fix: 'Click "Restart Gateway" below — this will regenerate the config and auth token.',
115
+ configState: { hasConfig, hasGateway, hasAuth, authMode },
116
+ });
111
117
  }
112
118
 
113
119
  // 60-second timeout