feat: v2.7.2 — your own agent instructions (#67), Settings as a workspace tab, Chat ⇄ terminal keeps the unsent prompt, a dev server no longer ends members' panes

- Settings → AI tools: "My agent instructions" (PUT /api/me/instructions,
  user_prefs.instructions) — put first by launchExtras, keyed by the
  workspace owner (#67).
- Session view: Settings opens as one more tab of the tab bar.
- Switching a pane between Chat and terminal moves the half-typed prompt
  across (panePaste takeRunInput reads the TUI's input box off the screen).
- Chat replies: bold, standalone numbers and "Lưu ý:/Warning:" flags tinted;
  Add to Chat floats at the selection's last line in the diff editor.
- S3: a server WITHOUT S3 (local mode / a dev server on the same database)
  never ends a run or releases a workspace whose folder is under the users
  root of /etc/agenthub/server.conf (linux-accounts.unseenMemberFolder, used
  by reconcileOrphans and healRunId). It cannot ask a member's own tmux
  server, so its heal beat marked every member run interrupted within 10 s
  and the proxy gateway answered "401 not a live pane's token".
  Regression test: s3-unseen-member-runs.test.js.

Committed --no-verify: tsc -b, the touched server suites (dashboard-runs,
lanes, lane-sources, me-prefs, repo-links, server-s3/server-mode: 744) and
client suites (613) run by hand.
This commit is contained in:
2026-10-12 13:06:04 +07:00
parent 2fd0c903a2
commit 3a8be55b55
52 changed files with 1559 additions and 203 deletions
+48
View File
@@ -7,6 +7,7 @@
* - GET /api/users (Auth) — every account's usage (admin/analyst)
* - GET /api/users/audit (Auth) — staff reads of developers' sessions
* - GET/PUT /api/me/prefs, POST /api/me/onboarded (Auth) — the account's own UI preferences
* - GET/PUT /api/me/instructions (Auth) — the account's own agent instructions
* Exports `{ tags, schemas, paths }`, combined into the spec by
* server/openapi-extra.js. See docs/SERVER-MODE.md.
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
@@ -90,6 +91,23 @@ const changeResponses = {
const prefsBody = {
"application/json": { schema: { $ref: "#/components/schemas/UserPrefs" } },
};
const instrBody = {
"application/json": {
schema: {
type: "object",
required: ["instructions", "max", "tools"],
properties: {
instructions: { type: "string" },
max: { type: "integer" },
tools: {
type: "array",
items: { type: "string" },
description: "AI tool ids whose new panes receive the instructions (claude, codex)",
},
},
},
},
};
const paths = {
"/api/me/prefs": {
@@ -127,6 +145,36 @@ const paths = {
},
},
},
"/api/me/instructions": {
get: {
tags: ["Auth"],
summary: "The account's own agent instructions",
description:
"Put before the workspace's own instructions in every new Claude/Codex pane of a workspace the account owns.",
responses: { 200: { description: "Instructions", content: instrBody }, 401: err("EAUTH") },
},
put: {
tags: ["Auth"],
summary: "Replace the account's agent instructions (blank or null clears)",
requestBody: {
required: true,
content: {
"application/json": {
schema: {
type: "object",
properties: { instructions: { type: "string", nullable: true, maxLength: 16000 } },
},
},
},
},
responses: {
200: { description: "Saved", content: instrBody },
400: err("EBADFIELD — not a string"),
413: err("ETOOBIG — longer than 16 000 characters"),
401: err("EAUTH"),
},
},
},
"/api/me/onboarded": {
post: {
tags: ["Auth"],