ai_co_discuss 0.5.65 → 0.5.67
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/.agents/skills/discuss-participant/references/manual.md +1 -1
- package/backend/execution_diagnostics.py +24 -0
- package/backend/free_room.py +16 -3
- package/backend/schema.sql +4 -0
- package/backend/server.py +104 -13
- package/docs/en/guide/admin.md +2 -2
- package/docs/en/guide/rooms.md +3 -3
- package/docs/en/guide/working.md +8 -5
- package/docs/guide/admin.md +2 -2
- package/docs/guide/rooms.md +3 -3
- package/docs/guide/working.md +8 -5
- package/frontend/locales/en/admin.json +6 -0
- package/frontend/locales/en/app.json +4 -0
- package/frontend/locales/en/backend.json +1 -0
- package/frontend/locales/en/backend_worker.json +2 -0
- package/frontend/locales/en/core.json +1 -1
- package/frontend/locales/en/discussion.json +0 -1
- package/frontend/locales/en/room.json +34 -5
- package/package.json +2 -2
- package/runner/adapters/antigravity_cli.mjs +16 -2
- package/runner/adapters/codex_app.mjs +2 -2
- package/runner/adapters/codex_cli.mjs +36 -166
- package/runner/adapters/codex_rollout.mjs +673 -0
- package/runner/adapters/common.mjs +3 -3
- package/runner/adapters/index.mjs +26 -0
- package/runner/adapters/log_worker.mjs +68 -0
- package/runner/admin_cli.mjs +6 -6
- package/runner/admin_panel.mjs +24 -2
- package/runner/discussion_launch.mjs +27 -11
- package/runner/discussion_runner.mjs +5 -2
- package/runner/discussion_service.mjs +12 -8
- package/runner/expert_prompts.mjs +4 -2
- package/runner/file_checkpoint.mjs +294 -74
- package/runner/file_diff.mjs +128 -9
- package/runner/free_runner.mjs +496 -236
- package/runner/i18n_en.mjs +10 -1
- package/runner/scheduler.mjs +6 -2
- package/runner/storage_guard.mjs +13 -0
- package/runner/workspace_worker.mjs +381 -0
- package/web/admin.css +1 -1
- package/web/admin.js +2 -2
- package/web/app.js +188 -64
- package/web/i18n.js +3 -3
- package/web/modern.css +1 -1
- package/web/modern.js +80 -82
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
没有任务文件本身不代表手动授权:若房间正在自动运行,等待本次交付或核对缺项,不从旧文件接管。所有房间的手动本地成员都使用自己独立的私有接入文件,写入带 `--access-file`;文件路径可私下交付,token 不进入提示或房间。房主控制文件不能代替成员文件署名。
|
|
6
6
|
|
|
7
|
-
首次读取房间后立即执行一次 `member register ROOM --
|
|
7
|
+
首次读取房间后立即执行一次 `member register ROOM --access-file FILE`(身份由凭据决定)。未注册前网站显示“待注册”,不算到场,也不会被安排发言或被本机服务接管。会话 ID 由 CLI 从宿主会话自动附带,不自行填写;凭证重新签发后须重新注册。
|
|
8
8
|
|
|
9
9
|
## 原会话与本机托管
|
|
10
10
|
|
|
@@ -6,6 +6,10 @@ import re
|
|
|
6
6
|
|
|
7
7
|
IDENTIFIER = re.compile(r"[A-Za-z0-9_-]{1,128}\Z")
|
|
8
8
|
REVISION = re.compile(r"[0-9a-f]{7,64}\Z")
|
|
9
|
+
# Members without a primary directory can see the room's main directory and all eight extras as extra roots.
|
|
10
|
+
WORKSPACE_ROOT = re.compile(r"(?:main|extra:[0-8])\Z")
|
|
11
|
+
WORKSPACE_OPERATIONS = ("diff", "checkpoint")
|
|
12
|
+
WORKSPACE_REASONS = ("scan_limit", "baseline_quota", "unavailable", "changed_during_read")
|
|
9
13
|
TIME_LIMITS = ("total_ms", "idle_ms")
|
|
10
14
|
MAX_LIMIT_MS = 7 * 24 * 60 * 60 * 1000
|
|
11
15
|
MAX_ITEMS = 50
|
|
@@ -99,6 +103,24 @@ def stored_diagnostics(connection, execution_id):
|
|
|
99
103
|
return json.loads(row[0]) if row else {}
|
|
100
104
|
|
|
101
105
|
|
|
106
|
+
def merge_workspace_issues(data, items):
|
|
107
|
+
"""Keep distinct failure evidence from known roots and discard arbitrary paths or messages."""
|
|
108
|
+
if not isinstance(items, list):
|
|
109
|
+
return
|
|
110
|
+
for item in items[:MAX_ITEMS]:
|
|
111
|
+
if not isinstance(item, dict):
|
|
112
|
+
continue
|
|
113
|
+
root = matching(item.get("root"), WORKSPACE_ROOT)
|
|
114
|
+
operation = selected(item.get("operation"), WORKSPACE_OPERATIONS)
|
|
115
|
+
reason = selected(item.get("reason"), WORKSPACE_REASONS)
|
|
116
|
+
if not (root and operation and reason):
|
|
117
|
+
continue
|
|
118
|
+
issues = data.setdefault("workspace_issues", [])
|
|
119
|
+
issue = {"root": root, "operation": operation, "reason": reason}
|
|
120
|
+
if issue not in issues:
|
|
121
|
+
issues.append(issue)
|
|
122
|
+
|
|
123
|
+
|
|
102
124
|
def record_diagnostics(connection, execution_id, payload, now):
|
|
103
125
|
"""Persist authorized evidence inside the transaction of the original execution action."""
|
|
104
126
|
action = payload.get("action")
|
|
@@ -120,6 +142,8 @@ def record_diagnostics(connection, execution_id, payload, now):
|
|
|
120
142
|
if action == "interjection":
|
|
121
143
|
merge_interjection(data, report, payload, now)
|
|
122
144
|
if action == "report":
|
|
145
|
+
merge_workspace_issues(data, report.get("workspace_issues"))
|
|
146
|
+
if action == "report" and "changes" in payload:
|
|
123
147
|
attribution = report.get("file_attribution")
|
|
124
148
|
omitted = attribution.get("omitted") if isinstance(attribution, dict) else None
|
|
125
149
|
if type(omitted) is int and 0 <= omitted <= 2**53 - 1:
|
package/backend/free_room.py
CHANGED
|
@@ -3616,7 +3616,8 @@ def notice_stalled_executions(connection, room_id):
|
|
|
3616
3616
|
rows = connection.execute("""SELECT e.id,e.activity_at,e.created_at,m.name,
|
|
3617
3617
|
(SELECT MAX(chain_id) FROM member_requests WHERE execution_id=e.id) AS chain_id
|
|
3618
3618
|
FROM member_executions e JOIN room_members m ON m.id=e.member_id
|
|
3619
|
-
WHERE e.room_id=? AND e.status IN ('dispatched','started') AND m.role<>'host' AND MAX(e.activity_at,e.created_at)<=?
|
|
3619
|
+
WHERE e.room_id=? AND e.status IN ('dispatched','started') AND m.role<>'host' AND MAX(e.activity_at,e.created_at)<=?
|
|
3620
|
+
AND NOT EXISTS(SELECT 1 FROM execution_capabilities c WHERE c.execution_id=e.id AND c.progress=0)""",
|
|
3620
3621
|
(room_id, now - STALL_SECONDS)).fetchall()
|
|
3621
3622
|
for row in rows:
|
|
3622
3623
|
quiet = max(row["activity_at"], row["created_at"])
|
|
@@ -3868,6 +3869,7 @@ def inbox_needs_maintenance(connection, room_id):
|
|
|
3868
3869
|
UNION ALL SELECT 1 FROM member_executions e JOIN room_members m ON m.id=e.member_id
|
|
3869
3870
|
WHERE e.room_id=:room AND e.status IN ('dispatched','started') AND m.role<>'host'
|
|
3870
3871
|
AND MAX(e.activity_at,e.created_at)<=:stall_at
|
|
3872
|
+
AND NOT EXISTS(SELECT 1 FROM execution_capabilities c WHERE c.execution_id=e.id AND c.progress=0)
|
|
3871
3873
|
AND EXISTS(SELECT 1 FROM room_members h WHERE h.room_id=e.room_id AND h.role='host' AND h.status='active')
|
|
3872
3874
|
AND EXISTS(SELECT 1 FROM member_requests r WHERE r.execution_id=e.id AND r.chain_id>0)
|
|
3873
3875
|
AND NOT EXISTS(SELECT 1 FROM free_host_wakes w WHERE w.room_id=e.room_id
|
|
@@ -4952,7 +4954,9 @@ def execution_action(connection, room_id, execution_id, token, payload, member=N
|
|
|
4952
4954
|
connection.execute("UPDATE member_executions SET delivered_files=? WHERE id=?", (files, execution_id))
|
|
4953
4955
|
elif json.loads(row["delivered_files"]) != payload["delivered_files"]:
|
|
4954
4956
|
raise FileExistsError("delivered_files already finalized")
|
|
4955
|
-
|
|
4957
|
+
diagnostics = payload.get("diagnostics")
|
|
4958
|
+
workspace_only = isinstance(diagnostics, dict) and isinstance(diagnostics.get("workspace_issues"), list)
|
|
4959
|
+
if "changes" in payload or ("delivered_files" not in payload and not workspace_only):
|
|
4956
4960
|
if row["changes"] and (provisional or not row["changes_provisional"]):
|
|
4957
4961
|
raise FileExistsError(Text("本次执行的改动已记录"))
|
|
4958
4962
|
changes = changed_files(payload)
|
|
@@ -5255,6 +5259,9 @@ def interrupt_member(connection, room_id, member_id, token, by_host=""):
|
|
|
5255
5259
|
return free_view(connection, room_id)
|
|
5256
5260
|
|
|
5257
5261
|
|
|
5262
|
+
QUEUE_RESTART_RESULT = "已打断:你立即发送了新消息,它会连同这条一起处理"
|
|
5263
|
+
|
|
5264
|
+
|
|
5258
5265
|
def interrupt_for_message(connection, room_id, message_id):
|
|
5259
5266
|
"""The owner's "send now" of a queued message to members still at work (user 2026-11-23, #7819): a member whose
|
|
5260
5267
|
software takes an interjection hears of it in its running turn, which then also answers it; any other is
|
|
@@ -5289,7 +5296,13 @@ def interrupt_for_message(connection, room_id, message_id):
|
|
|
5289
5296
|
"submission_id": f"queue-{message_id}-{row['member_id']}"}, now)
|
|
5290
5297
|
connection.execute("UPDATE member_requests SET status='delivering',execution_id=? WHERE id=?", (row["execution_id"], row["request_id"]))
|
|
5291
5298
|
for row in stopped:
|
|
5292
|
-
stop_member_work(connection, row["member_id"], notice if source else Text(
|
|
5299
|
+
stop_member_work(connection, row["member_id"], notice if source else Text(QUEUE_RESTART_RESULT), "user_stop", keep_pending=True, requeue=True)
|
|
5300
|
+
if not source:
|
|
5301
|
+
connection.execute("""INSERT OR IGNORE INTO restarted_message_parents(request_id,parent_message_id)
|
|
5302
|
+
SELECT ?,MIN(r.message_id) FROM retried_requests old JOIN member_requests r ON r.id=old.request_id
|
|
5303
|
+
JOIN messages parent ON parent.id=r.message_id AND parent.author='用户'
|
|
5304
|
+
WHERE old.execution_id=? AND r.room_id=? AND r.message_id<? HAVING COUNT(*)>0""",
|
|
5305
|
+
(row["request_id"], row["execution_id"], room_id, message_id))
|
|
5293
5306
|
if stopped:
|
|
5294
5307
|
settle_batches(connection, room_id)
|
|
5295
5308
|
return bool(busy)
|
package/backend/schema.sql
CHANGED
|
@@ -624,6 +624,10 @@ CREATE INDEX IF NOT EXISTS member_requests_room_chain ON member_requests(room_id
|
|
|
624
624
|
CREATE INDEX IF NOT EXISTS member_requests_room_status ON member_requests(room_id,status);
|
|
625
625
|
CREATE INDEX IF NOT EXISTS member_requests_by_message ON member_requests(room_id,message_id,status);
|
|
626
626
|
CREATE INDEX IF NOT EXISTS member_requests_batch ON member_requests(batch_id,status);
|
|
627
|
+
CREATE TABLE IF NOT EXISTS restarted_message_parents (
|
|
628
|
+
request_id INTEGER PRIMARY KEY REFERENCES member_requests(id) ON DELETE CASCADE,
|
|
629
|
+
parent_message_id INTEGER NOT NULL REFERENCES messages(id) ON DELETE CASCADE
|
|
630
|
+
);
|
|
627
631
|
-- Where a request's cards sit on the page: the room's latest message when the request was made. The page shows every
|
|
628
632
|
-- card (working, failed, stopped, answer) under the top-level message at or before it, ordered by when its work started,
|
|
629
633
|
-- whatever kind of request it is. Kept at creation so later messages never move it. Rows made before this table get the
|
package/backend/server.py
CHANGED
|
@@ -53,7 +53,7 @@ from . import moss_channel_sends
|
|
|
53
53
|
from .free_room import relay_provenance
|
|
54
54
|
from .free_room import ROOM_FAILURE_RESET_SQL, ROOM_WAITING_SINCE_SQL, STEWARD_SESSION_TEMPLATE, convert_suggestion, message_suggestions, replace_steward_member, save_suggestions, sync_participants
|
|
55
55
|
from .free_room import account_quotas, quota_plans, quota_usage, report_quota, save_quota_plan
|
|
56
|
-
from .free_room import HOST_WITHDRAW_RESULT, OWNER_INTERRUPT_RESULT, OWNER_REWIND_RESULT, OWNER_STOP_RESULT, observed_host_versions
|
|
56
|
+
from .free_room import HOST_WITHDRAW_RESULT, OWNER_INTERRUPT_RESULT, OWNER_REWIND_RESULT, OWNER_STOP_RESULT, QUEUE_RESTART_RESULT, observed_host_versions
|
|
57
57
|
from .free_room import adopt_recommendation, recommend_member, register_member, require_member
|
|
58
58
|
from .private_chat import chat_action, member_chat
|
|
59
59
|
from .external_members import external_api, guard_route as guard_external_route, is_external_path, owner_api as external_owner_api, require_external
|
|
@@ -155,6 +155,19 @@ MEDIA_GENERATION_TIMEOUT = 960
|
|
|
155
155
|
MEDIA_GENERATION_COMMANDS = ("image-generate", "video-generate")
|
|
156
156
|
MEDIA_ROOM_COMMANDS = MEDIA_GENERATION_COMMANDS + ("media-job",)
|
|
157
157
|
MEDIA_COMMANDS = MEDIA_ROOM_COMMANDS + ("video-settings", "video-check")
|
|
158
|
+
MEDIA_META_CHOICES = {
|
|
159
|
+
"mode": {"image", "video"}, "action": {"generate", "edit"},
|
|
160
|
+
"quality": {"auto", "low", "medium", "high", "xhigh", "max"},
|
|
161
|
+
"output_format": {"png", "jpeg", "webp", "gif", "svg", "mp4"},
|
|
162
|
+
"background": {"auto", "opaque", "transparent"}, "complexity": {"low", "medium", "high"},
|
|
163
|
+
"moderation": {"auto", "low"}, "input_fidelity": {"low", "high"},
|
|
164
|
+
}
|
|
165
|
+
MEDIA_META_INTEGERS = {"n": (1, 10), "seconds": (1, 2**53 - 1), "frame_count": (2, 16), "frame_duration_ms": (20, 2000)}
|
|
166
|
+
MEDIA_META_MODEL = re.compile(r"[A-Za-z0-9][A-Za-z0-9._:/@-]{0,127}")
|
|
167
|
+
MEDIA_META_SIZE = re.compile(r"(?:auto|[1-9][0-9]{0,4}x[1-9][0-9]{0,4})")
|
|
168
|
+
MEDIA_META_SECRET = re.compile(
|
|
169
|
+
r"(?i)(?:sk[-_]|gsk_|gh[pousr]_|akia|aiza|eyJ[a-z0-9_-]*\.|data:)|[a-f0-9]{32,}|[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}"
|
|
170
|
+
)
|
|
158
171
|
MACHINE_COMMAND_POLL_SECONDS = 0.5
|
|
159
172
|
# Ordering and filing a channel only rearrange the shared directory, like folder edits, so they need no room credential.
|
|
160
173
|
DIRECTORY_OPERATIONS = ("move", "folder", "detach")
|
|
@@ -319,19 +332,23 @@ MESSAGE_QUERY = """SELECT messages.*, COALESCE(details.kind,'opinion') AS kind,
|
|
|
319
332
|
COALESCE(details.submitted_by, CASE WHEN messages.source IN ('cli','api','url','user')
|
|
320
333
|
THEN messages.author ELSE '用户' END) AS submitted_by,
|
|
321
334
|
COALESCE(summaries.text,'') AS summary, COALESCE(summaries.author,'') AS summary_by, timing.elapsed_seconds,
|
|
335
|
+
media.message_id AS no_wake_id, media.media_meta,
|
|
322
336
|
answered.execution_id, answered.request_message_id, answered.layout_after, answered.layout_at, COALESCE(withdrawn.kind,'') AS withdrawn,
|
|
323
337
|
CASE WHEN messages.author='用户' THEN (
|
|
324
338
|
SELECT CASE WHEN COUNT(parent_id)=COUNT(*) AND MIN(parent_id)=MAX(parent_id) THEN MIN(parent_id) END
|
|
325
|
-
FROM (SELECT (SELECT MIN(original.message_id) FROM member_requests original
|
|
339
|
+
FROM (SELECT COALESCE(restart.parent_message_id, (SELECT MIN(original.message_id) FROM member_requests original
|
|
326
340
|
JOIN messages parent ON parent.id=original.message_id AND parent.author='用户'
|
|
327
341
|
WHERE original.room_id=messages.room_id AND (original.execution_id=i.execution_id OR original.id IN
|
|
328
342
|
(SELECT request_id FROM retried_requests WHERE execution_id=i.execution_id))
|
|
329
|
-
AND original.message_id<messages.id AND c.steer=1 AND i.status!='failed') AS parent_id
|
|
343
|
+
AND original.message_id<messages.id AND c.steer=1 AND i.status!='failed')) AS parent_id
|
|
330
344
|
FROM member_requests target LEFT JOIN execution_interjections i ON i.room_id=messages.room_id
|
|
331
345
|
AND i.submission_id='queue-' || messages.id || '-' || target.member_id
|
|
332
346
|
LEFT JOIN execution_capabilities c ON c.execution_id=i.execution_id
|
|
333
|
-
|
|
347
|
+
LEFT JOIN restarted_message_parents restart ON restart.request_id=target.id
|
|
348
|
+
WHERE target.room_id=messages.room_id AND target.message_id=messages.id)
|
|
334
349
|
) END AS interjection_parent_id,
|
|
350
|
+
EXISTS(SELECT 1 FROM member_requests r JOIN restarted_message_parents p ON p.request_id=r.id
|
|
351
|
+
WHERE r.room_id=messages.room_id AND r.message_id=messages.id) AS interjection_restarted,
|
|
335
352
|
EXISTS(SELECT 1 FROM proactive_messages p WHERE p.message_id=messages.id) AS proactive,
|
|
336
353
|
EXISTS(SELECT 1 FROM moss_silent_answers s WHERE s.message_id=messages.id) AS silent,
|
|
337
354
|
outbound.channel AS out_channel, outbound.state AS out_state,
|
|
@@ -357,6 +374,7 @@ COALESCE(NULLIF(relay.member,''),(SELECT name FROM room_members WHERE room_id=re
|
|
|
357
374
|
CASE WHEN relay.message_id IS NOT NULL THEN (SELECT m.name FROM member_requests q JOIN room_members m ON m.id=q.member_id
|
|
358
375
|
WHERE q.message_id=messages.id ORDER BY q.id LIMIT 1) END AS relay_to
|
|
359
376
|
FROM messages LEFT JOIN message_details AS details ON details.message_id=messages.id
|
|
377
|
+
LEFT JOIN message_no_wake AS media ON media.message_id=messages.id
|
|
360
378
|
LEFT JOIN moss_channel_out AS outbound ON outbound.message_id=messages.id
|
|
361
379
|
LEFT JOIN (SELECT message_id,target_room_id,host,target_message_id,queued_id,interrupted,state FROM room_relay_sends) AS sent
|
|
362
380
|
ON sent.message_id=messages.id
|
|
@@ -727,6 +745,47 @@ def migrate_dispatch_withdrawals(connection):
|
|
|
727
745
|
WHERE s.message_id=m.id)))""")
|
|
728
746
|
|
|
729
747
|
|
|
748
|
+
def migrate_restarted_message_parents(connection):
|
|
749
|
+
"""Recover historical links only when a successful queue send logged a new message and its interruption."""
|
|
750
|
+
if not connection.execute("""INSERT OR IGNORE INTO site_preferences(key,value)
|
|
751
|
+
VALUES('restarted_message_parents_v1','1')""").rowcount:
|
|
752
|
+
return
|
|
753
|
+
connection.execute("""WITH sends AS (
|
|
754
|
+
SELECT room_id,id,at,
|
|
755
|
+
at+COALESCE(CASE WHEN json_valid(data) THEN json_extract(data,'$.elapsed_ms') END,0)+1 AS ended
|
|
756
|
+
FROM room_events WHERE kind='api.write' AND json_valid(data)
|
|
757
|
+
AND CASE WHEN json_valid(data) THEN json_extract(data,'$.path') END='/queue'
|
|
758
|
+
AND CASE WHEN json_valid(data) THEN json_extract(data,'$.status') END=200
|
|
759
|
+
AND CASE WHEN json_valid(data) THEN
|
|
760
|
+
CASE WHEN json_valid(json_extract(data,'$.payload'))
|
|
761
|
+
THEN json_extract(json_extract(data,'$.payload'),'$.action')='send' END
|
|
762
|
+
END
|
|
763
|
+
), restarts AS (
|
|
764
|
+
SELECT e.room_id,e.id,
|
|
765
|
+
CASE WHEN json_valid(e.data) THEN json_extract(e.data,'$.execution_id') END AS execution_id,
|
|
766
|
+
CASE WHEN json_valid(e.data) THEN json_extract(e.data,'$.member_id') END AS member_id,
|
|
767
|
+
(SELECT p.id FROM room_events p WHERE p.room_id=e.room_id AND p.kind='message.posted'
|
|
768
|
+
AND p.id<e.id AND p.at BETWEEN s.at-1 AND e.at AND json_valid(p.data)
|
|
769
|
+
ORDER BY p.id DESC LIMIT 1) AS posted_id
|
|
770
|
+
FROM sends s JOIN room_events e ON e.room_id=s.room_id AND e.id<s.id AND e.kind='execution.changed'
|
|
771
|
+
AND e.at BETWEEN s.at-1 AND s.ended AND json_valid(e.data)
|
|
772
|
+
WHERE CASE WHEN json_valid(e.data) THEN json_extract(e.data,'$.status') END='cancelled'
|
|
773
|
+
AND CASE WHEN json_valid(e.data) THEN json_extract(e.data,'$.result') END=?
|
|
774
|
+
)
|
|
775
|
+
INSERT OR IGNORE INTO restarted_message_parents(request_id,parent_message_id)
|
|
776
|
+
SELECT target.id,MIN(parent.id) FROM restarts e JOIN room_events p ON p.id=e.posted_id AND json_valid(p.data)
|
|
777
|
+
JOIN messages m ON m.id=CASE WHEN json_valid(p.data) THEN json_extract(p.data,'$.message_id') END
|
|
778
|
+
AND m.room_id=e.room_id AND m.author='用户'
|
|
779
|
+
JOIN member_requests target ON target.room_id=e.room_id AND target.message_id=m.id AND target.member_id=e.member_id
|
|
780
|
+
JOIN retried_requests old ON old.execution_id=e.execution_id
|
|
781
|
+
JOIN member_requests original ON original.id=old.request_id AND original.room_id=e.room_id
|
|
782
|
+
JOIN messages parent ON parent.id=original.message_id AND parent.author='用户' AND parent.id<m.id
|
|
783
|
+
WHERE EXISTS(SELECT 1 FROM room_events r WHERE r.room_id=e.room_id AND r.kind='request.created'
|
|
784
|
+
AND r.id>p.id AND r.id<e.id AND json_valid(r.data)
|
|
785
|
+
AND CASE WHEN json_valid(r.data) THEN json_extract(r.data,'$.request_id') END=target.id)
|
|
786
|
+
GROUP BY target.id HAVING COUNT(DISTINCT e.execution_id)=1""", (QUEUE_RESTART_RESULT,))
|
|
787
|
+
|
|
788
|
+
|
|
730
789
|
def migrate_guest_cancel_reasons(connection):
|
|
731
790
|
"""Extend the cancellation constraint without discarding existing reasons or replaying their events."""
|
|
732
791
|
definition = connection.execute("SELECT sql FROM sqlite_master WHERE name='request_cancel_reasons'").fetchone()[0]
|
|
@@ -818,12 +877,16 @@ def init_database(database, seed=True):
|
|
|
818
877
|
moss_results.migrate_delegations(connection)
|
|
819
878
|
connection.executescript(SCHEMA + cloud_shares.SCHEMA)
|
|
820
879
|
connection.execute("""CREATE TABLE IF NOT EXISTS message_no_wake (
|
|
821
|
-
message_id INTEGER PRIMARY KEY REFERENCES messages(id) ON DELETE CASCADE
|
|
880
|
+
message_id INTEGER PRIMARY KEY REFERENCES messages(id) ON DELETE CASCADE,
|
|
881
|
+
media_meta TEXT
|
|
822
882
|
)""")
|
|
883
|
+
if "media_meta" not in {row[1] for row in connection.execute("PRAGMA table_info(message_no_wake)")}:
|
|
884
|
+
connection.execute("ALTER TABLE message_no_wake ADD COLUMN media_meta TEXT")
|
|
823
885
|
migrate_guest_cancel_reasons(connection)
|
|
824
886
|
if "redirect_message_id" not in {row[1] for row in connection.execute("PRAGMA table_info(dispatch_withdrawals)")}:
|
|
825
887
|
connection.execute("ALTER TABLE dispatch_withdrawals ADD COLUMN redirect_message_id INTEGER REFERENCES messages(id) ON DELETE SET NULL")
|
|
826
888
|
migrate_dispatch_withdrawals(connection)
|
|
889
|
+
migrate_restarted_message_parents(connection)
|
|
827
890
|
if 'member' not in {row[1] for row in connection.execute('PRAGMA table_info(message_relays)')}:
|
|
828
891
|
connection.execute("ALTER TABLE message_relays ADD COLUMN member TEXT NOT NULL DEFAULT ''")
|
|
829
892
|
connection.execute("DELETE FROM room_links WHERE relation='peer'")
|
|
@@ -944,9 +1007,8 @@ def steward_archived_at(connection, room_id):
|
|
|
944
1007
|
return row[0] if row else None
|
|
945
1008
|
|
|
946
1009
|
|
|
947
|
-
# Keep
|
|
948
|
-
|
|
949
|
-
RUNNER_HOST_PENDING_SQL = """r.status='pending' AND r.created_by='host'
|
|
1010
|
+
# Keep the room running while a runner-woken request is waiting for its execution to be reserved.
|
|
1011
|
+
RUNNER_PENDING_SQL = """r.status='pending' AND r.created_by IN ('host','user')
|
|
950
1012
|
AND m.status='active' AND m.access='runner'
|
|
951
1013
|
AND NOT EXISTS (SELECT 1 FROM member_sessions s JOIN member_adopt_failures af
|
|
952
1014
|
ON af.member_id=s.member_id AND af.session_id=s.session_id WHERE s.member_id=m.id)"""
|
|
@@ -954,7 +1016,7 @@ ROOM_RUNNING_SQL = f"""(
|
|
|
954
1016
|
EXISTS (SELECT 1 FROM member_executions e WHERE e.room_id=rooms.id
|
|
955
1017
|
AND e.status IN ('dispatched','started') AND e.lease_until>:now)
|
|
956
1018
|
OR EXISTS (SELECT 1 FROM member_requests r JOIN room_members m ON m.id=r.member_id
|
|
957
|
-
WHERE r.room_id=rooms.id AND {
|
|
1019
|
+
WHERE r.room_id=rooms.id AND {RUNNER_PENDING_SQL})
|
|
958
1020
|
)"""
|
|
959
1021
|
ROOM_WAITS_SQL = f"""
|
|
960
1022
|
SELECT room_id,created_at AS since FROM room_waits WHERE ended_at=0
|
|
@@ -1450,7 +1512,7 @@ def list_rooms(connection, params=None, *, include_group_windows=False, exclude_
|
|
|
1450
1512
|
WHERE status IN ('dispatched','started') AND lease_until>:now
|
|
1451
1513
|
UNION
|
|
1452
1514
|
SELECT r.room_id FROM room_members m CROSS JOIN member_requests r ON r.member_id=m.id
|
|
1453
|
-
WHERE {
|
|
1515
|
+
WHERE {RUNNER_PENDING_SQL}
|
|
1454
1516
|
),
|
|
1455
1517
|
delivery_failures AS (
|
|
1456
1518
|
SELECT DISTINCT m.room_id FROM member_adopt_failures f JOIN room_members m ON m.id=f.member_id
|
|
@@ -2895,6 +2957,9 @@ def record_api_event(database, record):
|
|
|
2895
2957
|
data["execution_id"] = execution_id
|
|
2896
2958
|
redacted_texts = {}
|
|
2897
2959
|
payload_to_log = record["payload"]
|
|
2960
|
+
if isinstance(payload_to_log, dict) and "media_request" in payload_to_log:
|
|
2961
|
+
# Audit records include rejected writes. Never record the raw display metadata there.
|
|
2962
|
+
payload_to_log = {key: value for key, value in payload_to_log.items() if key != "media_request"}
|
|
2898
2963
|
if record["path"].startswith("/executions/") and isinstance(payload_to_log, dict):
|
|
2899
2964
|
payload_to_log = {key: value for key, value in payload_to_log.items() if key != "diagnostics"}
|
|
2900
2965
|
if isinstance(payload_to_log, dict) and "host_strategy" in payload_to_log:
|
|
@@ -3472,6 +3537,8 @@ def renumbered_expected(expected, payload, previous):
|
|
|
3472
3537
|
def message_with_attachments(connection, row):
|
|
3473
3538
|
"""Attach the published file list to an original message."""
|
|
3474
3539
|
message = dict(row)
|
|
3540
|
+
message.pop("no_wake_id", None)
|
|
3541
|
+
media_meta = message.pop("media_meta", None)
|
|
3475
3542
|
chain, origin, speak = (message.pop(key, None) for key in ("relay_chain", "relay_origin", "relay_speak"))
|
|
3476
3543
|
if origin:
|
|
3477
3544
|
message["relay_speak"] = bool(speak)
|
|
@@ -3497,6 +3564,8 @@ def message_with_attachments(connection, row):
|
|
|
3497
3564
|
if message["withdrawn"] == "retracted":
|
|
3498
3565
|
# The owner retracted it before anyone handled it: only the page that retracted it keeps the text.
|
|
3499
3566
|
return {**message, "text": "", "summary": "", "suggestions": [], "attachments": []}
|
|
3567
|
+
if media_meta:
|
|
3568
|
+
message["media_request"] = json.loads(media_meta)
|
|
3500
3569
|
message["texts"] = load_texts(connection, "message", message["id"])
|
|
3501
3570
|
template = message["texts"].get("trigger", {}).get("template")
|
|
3502
3571
|
if template in (STEWARD_PROACTIVE_TEMPLATE, STEWARD_SESSION_TEMPLATE, "steward_scheduled"):
|
|
@@ -4853,9 +4922,31 @@ def wake_group_window(connection, room_id, payload):
|
|
|
4853
4922
|
return {"request_id": request_id, "message_id": message_id, "duplicate": False}
|
|
4854
4923
|
|
|
4855
4924
|
|
|
4925
|
+
def clean_media_request(raw):
|
|
4926
|
+
"""Keep only bounded, flat display values, without copying arbitrary request fields."""
|
|
4927
|
+
if not isinstance(raw, dict):
|
|
4928
|
+
return None
|
|
4929
|
+
cleaned = {}
|
|
4930
|
+
for key, choices in MEDIA_META_CHOICES.items():
|
|
4931
|
+
value = raw.get(key)
|
|
4932
|
+
if isinstance(value, str) and value in choices:
|
|
4933
|
+
cleaned[key] = value
|
|
4934
|
+
for key, (minimum, maximum) in MEDIA_META_INTEGERS.items():
|
|
4935
|
+
value = raw.get(key)
|
|
4936
|
+
if type(value) is int and minimum <= value <= maximum:
|
|
4937
|
+
cleaned[key] = value
|
|
4938
|
+
for key, pattern in (("model", MEDIA_META_MODEL), ("size", MEDIA_META_SIZE)):
|
|
4939
|
+
value = raw.get(key)
|
|
4940
|
+
if isinstance(value, str) and len(value) <= 128 and pattern.fullmatch(value):
|
|
4941
|
+
if key != "model" or not MEDIA_META_SECRET.match(value):
|
|
4942
|
+
cleaned[key] = value
|
|
4943
|
+
return json.dumps(cleaned, separators=(",", ":"), sort_keys=True) if cleaned else None
|
|
4944
|
+
|
|
4945
|
+
|
|
4856
4946
|
def append_free_message(connection, room, payload, actor):
|
|
4857
4947
|
"""Append a free-room message: the owner's creates requests, a member's completes its execution."""
|
|
4858
4948
|
no_wake = payload.get("no_wake") is True
|
|
4949
|
+
media_meta = clean_media_request(payload.get("media_request")) if no_wake else None
|
|
4859
4950
|
awaiting_user = awaiting_user_flag(payload, actor)
|
|
4860
4951
|
silent = actor != "用户" and payload.get("execution_id") is not None and room.get("system_kind") == "steward_group"
|
|
4861
4952
|
if payload.get("kind") == "moderation":
|
|
@@ -4886,13 +4977,13 @@ def append_free_message(connection, room, payload, actor):
|
|
|
4886
4977
|
identifiers = attachment_ids(payload)
|
|
4887
4978
|
previous = connection.execute(f"{MESSAGE_QUERY} WHERE room_id=? AND submission_id=?", (room_id, room_id, submission_id)).fetchone()
|
|
4888
4979
|
if previous:
|
|
4980
|
+
same_media = no_wake == bool(previous["no_wake_id"]) and media_meta == previous["media_meta"]
|
|
4889
4981
|
previous = message_with_attachments(connection, previous)
|
|
4890
4982
|
if ((previous.get("relay_room") or None) != (payload.get("relay") or {}).get("room_id")
|
|
4891
4983
|
or any(previous[key] != renumbered_expected(expected, payload, previous)[key] for key in ("author", "text", "reply_to", "kind", "submitted_by", "summary", "summary_by"))
|
|
4892
4984
|
or [item["id"] for item in previous["attachments"]] != identifiers
|
|
4893
4985
|
or silent != previous.get("silent", False)
|
|
4894
|
-
or (actor == "用户" and
|
|
4895
|
-
"SELECT 1 FROM message_no_wake WHERE message_id=?", (previous["id"],)).fetchone()))
|
|
4986
|
+
or (actor == "用户" and not same_media)
|
|
4896
4987
|
or awaiting_user != bool(connection.execute("SELECT 1 FROM room_waits WHERE message_id=?", (previous["id"],)).fetchone())):
|
|
4897
4988
|
raise FileExistsError(Text('这个提交编号已被另一条内容使用,请为新发言生成新编号'))
|
|
4898
4989
|
check_review_retry(connection, room_id, previous["id"], payload)
|
|
@@ -4927,7 +5018,7 @@ def append_free_message(connection, room, payload, actor):
|
|
|
4927
5018
|
connection.execute("INSERT INTO message_details (message_id,kind,submitted_by) VALUES (?,?,?)",
|
|
4928
5019
|
(cursor.lastrowid, "chat", submitted_by))
|
|
4929
5020
|
if no_wake:
|
|
4930
|
-
connection.execute("INSERT INTO message_no_wake(message_id) VALUES(
|
|
5021
|
+
connection.execute("INSERT INTO message_no_wake(message_id,media_meta) VALUES(?,?)", (cursor.lastrowid, media_meta))
|
|
4931
5022
|
if silent:
|
|
4932
5023
|
connection.execute("INSERT INTO moss_silent_answers(message_id) VALUES(?)", (cursor.lastrowid,))
|
|
4933
5024
|
connection.execute("INSERT INTO message_summaries (message_id,text,author) VALUES (?,?,?)",
|
package/docs/en/guide/admin.md
CHANGED
|
@@ -16,7 +16,7 @@ Use the local management panel or the corresponding codiscuss admin commands to
|
|
|
16
16
|
|
|
17
17
|
On the right of Overview → This computer → Self-hosted relay, pick the region in the Relay region dropdown. The default is Asia Pacific. This setting applies to administrator access, hosted account sign-in through the relay, and external expert invitations. Automatic creates the object near the first party to connect, usually the computer’s network exit. Its location stays fixed after creation. Other values are location hints. After the service syncs the change, the computer and paired devices reconnect automatically. Run `codiscuss admin site region` to inspect the setting or `codiscuss admin site region weur` to select Western Europe.
|
|
18
18
|
- **Hosted account entry** (shown when hosting is enabled): Start or stop the **Sign-in entry**, enable **Self-hosted relay**, or configure the **Cloudflare Tunnel**.
|
|
19
|
-
- **Settings:** View the installed version, select **Check for updates** or **Update and restart** (which also updates room skills and isolated accounts), enable **Start when signing in to Windows** and **Hosting** (see step 1 of “Set it up” below), and change the panel language. Under “Language · 语言”, pick “Display time zone” to update the panel’s times immediately. The panel and the room site keep separate preferences because they use different addresses.
|
|
19
|
+
- **Settings:** View the installed version, select **Check for updates** or **Update and restart** (which also updates room skills and isolated accounts). If the installed version has a problem, select **Other versions**, pick one of the latest 10 published versions (the previous one is preselected) and select **Install and restart** to go back. An older version may not understand data written by a newer one; if anything goes wrong after going back, update to the latest version again, enable **Start when signing in to Windows** and **Hosting** (see step 1 of “Set it up” below), and change the panel language. Under “Language · 语言”, pick “Display time zone” to update the panel’s times immediately. The panel and the room site keep separate preferences because they use different addresses.
|
|
20
20
|
- **Storage:**
|
|
21
21
|
- View local `.codiscuss` data usage against the 10 GiB limit (excluding speech models), total drafts against 3 GiB (1 GiB per room), **Room records & attachments (`local/`)**, disk free space and safety reserve, per-room and per-member breakdowns, and any unreadable entries. Local TTS and STT models are listed separately and excluded from the 10 GiB cap (covering both legacy and custom model paths, including when the service home itself is a symlink or junction).
|
|
22
22
|
- When `.codiscuss` data reaches the 8 GiB warning threshold, the **Storage** tab shows a warning dot and displays a notice; exceeding a limit or dropping below the disk safety reserve pauses new runs. The total is split into five named directories and Other. **Safe cleanup** removes registered failed scratch, speech cache entries, empty orphan directories, stale launches containing only setup records, and local execution files more than 24 hours after completion. After clearing the speech cache, replaying old content with cloud speech synthesizes it again and incurs a new charge. **Deep repair** estimates space before you select and confirm deletion of finished logs, including the last day.
|
|
@@ -136,7 +136,7 @@ Every command in the table is prefixed by codiscuss admin and returns JSON. Thes
|
|
|
136
136
|
| Task | Commands |
|
|
137
137
|
| --- | --- |
|
|
138
138
|
| View subscription utilization (8 weeks by default) | `codiscuss admin quota-usage [--weeks N]` |
|
|
139
|
-
| Start, exit, restart, or update (panel need not be running) | `codiscuss admin start`, `stop`, `restart`, `update [check]` |
|
|
139
|
+
| Start, exit, restart, or update (panel need not be running) | `codiscuss admin start`, `stop`, `restart`, `update [check\|versions\|<version>]` (e.g. `update 0.5.65` to go back to that version) |
|
|
140
140
|
| Check status, control service, configure sign-in startup and hosting | `status [--full]`, `service start\|stop\|restart`, `autostart on\|off`, `hosting on\|off` |
|
|
141
141
|
| Inspect storage usage and clear temporary run files | `storage`, `storage clean`, `storage repair` (preview), `storage repair logs --confirm` |
|
|
142
142
|
| Ask the platform steward to analyze storage | `codiscuss admin storage analyze` |
|
package/docs/en/guide/rooms.md
CHANGED
|
@@ -81,7 +81,7 @@ When viewing a project image through the relay on another device, supported imag
|
|
|
81
81
|
### 4. Send and view attachments
|
|
82
82
|
|
|
83
83
|
- **Attach files.** Paste or drag files into the composer, or use the paperclip button at the bottom-left. Each message can contain up to 10 files (the administrator’s “local page” streams straight to disk without the default 50 MiB per-file cap, while still counting toward `.codiscuss`’s 10 GiB local data cap—upload very large files under “Project files” instead, or free space via “Manage attachments” in the room menu; other entries default to 50 MiB, configurable in the management panel). Thumbnails appear above the composer. A placeholder such as `[Image #1]` or `[File #2]` is inserted at the cursor. Removing the thumbnail or deleting its placeholder with Backspace removes both. After sending, images first referenced in a paragraph or list item appear right below it in a two-column half-width grid (full width for a single image on phones, two columns for multiple, with `#n` badges when a message carries more than one image) and are not listed again below; other attachments stay listed under the message. Windows sites automatically generate smaller previews for eligible PNG and JPEG uploads. Open the image to view the original. The site automatically clears uploads left unsent for more than 24 hours. Attachments in sent or queued messages are kept.
|
|
84
|
-
- **Large files are sent as temporary files.** On the administrator’s “local page” of a computer-hosted install (`127.0.0.1` or `localhost`), attachments stream straight onto this computer without using the cloud space or the default 50 MiB per-file cap (they still count toward `.codiscuss`’s 10 GiB local data cap; upload very large files under “Project files” instead), and videos are not force-compressed (local AI members sending or downloading attachments on the local site likewise stream directly without using the cloud space). With cloud space configured, the app estimates whether switching makes sense for uploads, whole-file downloads with measurable progress, and original image previews on paired devices, including GIFs without thumbnails. It
|
|
84
|
+
- **Large files are sent as temporary files.** On the administrator’s “local page” of a computer-hosted install (`127.0.0.1` or `localhost`), attachments stream straight onto this computer without using the cloud space or the default 50 MiB per-file cap (they still count toward `.codiscuss`’s 10 GiB local data cap; upload very large files under “Project files” instead), and videos are not force-compressed (local AI members sending or downloading attachments on the local site likewise stream directly without using the cloud space). With cloud space configured, the app estimates whether switching makes sense for uploads, whole-file downloads with measurable progress, and original image previews on paired devices, including GIFs without thumbnails. It uses recent measured speeds before starting and checks again about one second into a transfer. It can switch if it expects to save at least three seconds and half the remaining time. If the original route slows down, two consecutive estimates must meet that same threshold. A transfer that receives or sends no new bytes for 6–12 seconds can also switch. Each file switches at most once, and the app periodically tries the original route to detect recovery. Native previews and PDFs loaded page by page are never interrupted. They only show a tip for opening or downloading via cloud drive, after six seconds when no recent measurements are available. Opening the image viewer immediately stops the relay read for that card and reuses any cloud transfer already in progress. As soon as the viewer gets a cloud link, it shows cloud loading status at the top if a thumbnail is visible, or in the loading placeholder otherwise. The status disappears when the original is ready. A failed preview offers “Open via cloud drive”. Document previews that read the file contents need the bucket to allow cross-origin reads from your CoDiscuss site. Once every byte has been sent, the app waits for confirmation without resending. If an automatic switch fails, the current transfer returns to its original route. If a switch fails or does not save enough time, automatic switching in that direction pauses for 90 seconds. Larger hosted downloads prefer a cloud link immediately. For eligible attachments, the “…” menu on the message card or in the file preview also offers “Download via cloud drive”. Opening and downloading use a 24-hour transfer copy. When a small attachment switches to cloud drive because the upload is slow, the computer retrieves it, saves it as a regular local attachment, and deletes the temporary cloud copy. Images (including GIFs), videos, and other files keep their usual attachment previews and do not expire under the cloud retention policy. On other devices, hosted accounts, or the online website, when an administrator has set up the cloud space (see [Management panel](admin.md)), files larger than the threshold (20 MiB by default, up to 2 GiB each) upload straight to the account's cloud space. Upload progress shows under the thumbnail; removing the thumbnail cancels the upload. They are temporary files, kept 7 days by default (an administrator can set 1–90 days): their cards say “Temporary file · size · Expires in N days” with a clock, “Expires today” in the warning colour under a day, and the card greys out with “Expired” afterwards. To keep one, choose “Keep in cloud drive” before it expires. Messages do not load their thumbnails or players; selecting the card downloads the file, and the “⋯” at its right offers “Preview” (images, audio, video and PDF), “Keep in cloud drive” and “Download”. A preview reads straight from the cloud space: video can be dragged to any point, and when the link expires during a long stop it renews itself and carries on from the same place; a PDF opens in a new tab. When the cloud space cannot be reached or the file was deleted, the card shows “Object storage is unavailable right now” or “Deleted”. Once the cloud space is full, new large uploads fail; delete old files under “Cloud space” on the Files page. Editing, taking back, or taking a queued message back into the composer leaves these files out; add them again. Share pages and exported backups do not include these files. Without the cloud space, files over the attachment limit cannot be added.
|
|
85
85
|
- **Read cloud attachments as a member.** Before waking a local member, CoDiscuss caches the attachment on that computer and gives the member its path. Read-only members can read that copy, and other members reuse it. The cache holds up to 20 GiB and evicts the least recently used files that no active task needs. If the automatic download fails, or to retrieve an earlier attachment, use `codiscuss attachment download ROOM ID` to save it to the same cache. To keep working on it in a project, have a member copy it from the cache into the project, or download it and upload it to the project.
|
|
86
86
|
- **View attachments.** After sending a message, select its placeholder or attachment card. Images can be enlarged full-screen, zoomed, rotated, and saved; when the room has several images, the side buttons, the left and right arrow keys, or a sideways swipe on a phone step between them (the side buttons hide when idle and return when you move the mouse or tap the image). Audio and video play in the message. Documents and code open in the file preview. An attachment card has at most one button: images have none, and “Keep in cloud drive” and “Download” (save the image) are in the image viewer's bottom toolbar; file, audio and video cards have a “⋯” at their right (beside the file name for audio and video) offering “Keep in cloud drive” (with the cloud space set up) and “Download”. On the administrator's local page, the image viewer's bottom toolbar, attachment card “⋯” menus, and the preview window's “…” menu also offer these two actions. Files that open in the file preview (both project files and message attachments) offer “Download” on the top bar and, when cloud space is configured, “Keep in cloud drive” to its left (temporary files also show “Expires in N days”). Wherever both appear, “Keep in cloud drive” is on the left (on top in a menu) and “Download” on the right. “Keep in cloud drive” copies the attachment into a long-term cloud drive file of the account, leaving the original on the computer or the temporary file as it is; its progress shows in the Files page's transfer list, with one notice at the bottom right when it is done. For one this page has already kept, the viewer's button is greyed out and says “Kept in the cloud drive”.
|
|
87
87
|
- **Interactive visualizations.** A member can place a small web page you can operate (drag a slider, press a button, watch the result change) inside the answer text. It appears at that point in the answer, follows the room theme and light or dark mode, and also appears in place on a phone. It starts running when you scroll near it. On a computer, tool buttons appear in its top-right corner when you point at it: view the “Source”, “Open larger preview” in the file preview, open it in a “New tab”, “Download” it as an `.html` file, or “Collapse” it (your choice is remembered). On a phone the corner always shows a “…” menu and the collapse button. A collapsed visualization shows as one “Interactive visualization” line; select “Expand” to bring it back. Members add these on their own when you ask for an illustrated answer, or when they explain a structure, process, or data. When a long answer is folded, its visualizations still appear, and one the fold cuts through shows only its top; select “Show full text” to see all of it. Read-only share pages and read-aloud show a single “Interactive visualization” line instead, so rely on the member's written conclusion. `.html` attachments do not run inside messages; select the file card to open them in the preview or a new tab. Some visualizations are question panels: after you rank, allocate, or adjust and press the panel's submit button, the result is added above the message box as a quote rather than sent. You can edit or remove it, and it counts as your reply only when you send it. Submitting the same panel again replaces its earlier result.
|
|
@@ -91,7 +91,7 @@ When viewing a project image through the relay on another device, supported imag
|
|
|
91
91
|
|
|
92
92
|
Enable “Image generation” or “Video generation” in the new-room panel or under “Room → Collaboration settings”. For images, choose “API image generation”, “Codex subscription image generation”, or “Enable both”. API images and video use the service settings on the connected computer. After entering an endpoint, key, model, and limits, select “Test connection” to check the configuration without generating media. Local administrators and owners on paired devices can generate media without importing a separate room credential when the page can manage the room.
|
|
93
93
|
|
|
94
|
-
- On desktop (over 700 px), point at the mode capsule outside the left edge of the composer to expand it and select “Text”, “Image generation”, or “Video generation”. On narrow screens (700 px or less), tap the slim mode tab outside the left edge of the composer to switch modes
|
|
94
|
+
- On desktop (over 700 px), point at the mode capsule outside the left edge of the composer to expand it and select “Text”, “Image generation”, or “Video generation”. On narrow screens (700 px or less), tap the slim mode tab outside the left edge of the composer to expand the mode panel and switch modes (selecting a mode or tapping outside collapses it back; use the same tab to return to “Text”). In a media mode, select “Media options” next to the paperclip to adjust model, size, quality, or format, enter a prompt, and select generate. The result appears as an attachment without waking the host or other members. Image generation defaults to one image. Use the “Image count” section at the bottom of “Media options” to choose more, up to the configured “Maximum image count” (at most 10).
|
|
95
95
|
- On a tablet or touchscreen computer (over 700 px), tap the capsule outside the left edge of the composer to expand it, then tap a mode. Selecting an available mode or tapping outside collapses it. Tapping a dimmed mode tells you why it is unavailable.
|
|
96
96
|
- To edit an image, add image attachments and choose the reference, mask, or markup in “Media options”. Video generation uses the first image attachment as its reference. In a room that only uses Codex subscription image generation, stay in “Text” mode and ask the host or an image specialist.
|
|
97
97
|
- If something fails, the notice at the bottom right explains why and the draft stays in place. Refreshing the page or returning to the room resumes checking unfinished jobs. If only some images were saved or posting failed, you can post the retained attachments without generating again. Select “Discard media job” if you no longer want to post them.
|
|
@@ -131,7 +131,7 @@ A message from another room goes to this room's current host: an idle host takes
|
|
|
131
131
|
- **Notice when a room's work ends.** When all work in another room ends (it changes from "Running" to idle) and stays ended for a few seconds, the page shows "Work in room \"Room name\" has ended" in the lower-right corner. The room you are viewing is not announced, and neither is work that stops and resumes at once, as with an interjection or a retry. The page must be open.
|
|
132
132
|
- **Shared directories are not locked.** If members edit the same project file at once, the page shows a conflict notification while the room is open. It is not added to the message history and does not wake the host.
|
|
133
133
|
- Read large assets and repositories in their project folders. Never copy them into a member’s draft folder or its `.scratch` subfolder, even when the project is read-only. If a writable copy is necessary, ask the owner to designate a writable project folder.
|
|
134
|
-
- **Storage and limits.** When connected to the local service or a paired computer, the **Storage** section at the bottom of the **Room** tab (expanded by default) shows usage (1 GiB per room, 3 GiB across all drafts, and 10 GiB for local `.codiscuss` data excluding speech models). If the room has attachments, an **Attachments** row below shows how much space they take; attachments are stored with the room records, do not count toward the draft quota, and are not removed by **Clear temporary files**. The room owner can select **Manage attachments** at the bottom to free attachment space: filter by type (images, audio & video, archives, documents, other) and age (older than 7 or 30 days), sorted largest first; the footer shows how much the selection frees. Select **Clear selected**, then **Confirm clear (cannot be undone)**. Messages stay, and each cleared attachment keeps its name, size and image thumbnail and is marked **Cleared**, but the original can no longer be opened, downloaded or read by members, and share pages and export packages no longer include it. The bar and text turn amber at 80% and red when over the limit (pausing new runs);
|
|
134
|
+
- **Storage and limits.** When connected to the local service or a paired computer, the **Storage** section at the bottom of the **Room** tab (expanded by default) shows usage (1 GiB per room, 3 GiB across all drafts, and 10 GiB for local `.codiscuss` data excluding speech models). If the room has attachments, an **Attachments** row below shows how much space they take; attachments are stored with the room records, do not count toward the draft quota, and are not removed by **Clear temporary files**. The room owner can select **Manage attachments** at the bottom to free attachment space: filter by type (images, audio & video, archives, documents, other) and age (older than 7 or 30 days), sorted largest first; the footer shows how much the selection frees. Select **Clear selected**, then **Confirm clear (cannot be undone)**. Messages stay, and each cleared attachment keeps its name, size and image thumbnail and is marked **Cleared**, but the original can no longer be opened, downloaded or read by members, and share pages and export packages no longer include it. The bar and text turn amber at 80% and red when over the limit (pausing new runs); the site also shows a warning at 8 GiB. Reloading on the same day does not repeat it for the same site and account. The site alerts you again at 10 GiB or when it detects an over-limit state, and when usage is observed dropping below 8 GiB and then reaches the warning threshold again. Hosted accounts can clear temporary files or attachments under Room → Storage, destroy old rooms, or contact the administrator. Local administrators still see directions to the management panel Storage page; **Draft storage** only counts unreadable entries in this room's drafts, while the computer-wide count is on the management panel **Storage** page. The room owner can select **Clear temporary files** in the expanded section to remove confirmed finished execution `.scratch` folders. If older drafts block the room and the [platform steward](steward.md) can still take requests, ask it to inventory them and delete rebuildable copies only after confirmation; room records and attachments (`local/`) are never deleted automatically; clear attachment originals with **Manage attachments**, or destroy old rooms to free space. Limits rely on periodic sampling rather than a filesystem write-layer hard quota and cannot guarantee the disk will never fill.
|
|
135
135
|
During active runs, the service checks free space on its own volume every two seconds. While part of the 10 GiB budget remains, a drop in free space as large as that remainder triggers an early scan. When a run ends, the service updates that member’s draft usage. A manual retry after cleanup rechecks the limit that blocked the run. If a machine-wide limit was exceeded, the service measures machine-wide usage again. If another program writes to the volume, runs continue when measured usage is within limits and the unreadable count is stable. If an early scan finds more unreadable entries, dispatch pauses and the service requests stops for stoppable runs. Dispatch resumes when a later scan finds a stable count, usage within limits and enough free disk space. The low-disk reserve applies independently. At 80% of the room draft limit, new runs without confirmed stop support are paused. Writes can continue between and during scans, and ongoing unstoppable runs can keep writing. Project files, system temporary files and third-party AI data outside the service directory are excluded. Follow the cleanup instructions on the failed run’s card, then select “Retry” on that card from the computer or a paired device.
|
|
136
136
|
- **Preview and transfer limits.** Text previews show at most the first 128 KB. When another device accesses media and documents through the computer, each file is limited to 64 MB. The web app first attempts to compress videos larger than 3 MiB. Links pointing outside a project directory appear disabled and are rejected.
|
|
137
137
|
- **A branch does not copy project files.** Branched and original rooms share the same project directory. Branching requires a connection to the local service.
|
package/docs/en/guide/working.md
CHANGED
|
@@ -18,7 +18,7 @@ Message a member or host, understand main and branch work and assignment labels,
|
|
|
18
18
|
- When you send an image, the page keeps its local preview. The message receipt and member status updates preserve your reading position after sending.
|
|
19
19
|
- **Send several messages in a row.** You can send the next message while the previous one still shows “Sending…”. If the room is busy and a message is expected to queue, it appears immediately above the composer. The confirmed queue entry takes its place. The browser submits messages in order and continues if one fails. The failed card keeps the original text and attachments so you can resend or discard it. Sending and network retries continue if you switch rooms. Return to the original room to find its failed cards. Refreshing or closing the page clears unsent messages held by that page.
|
|
20
20
|
|
|
21
|
-
Once the site returns a message number, known recipients appear below the message. If an automatically connected member is busy and the request must wait for its current task to finish, a one-line notice with a clock shows the member’s name and the queued message number. Hover over the notice to see how long the request has waited. The working card takes its place when the member starts. If smart scheduling needs to choose the recipient, the page shows scheduling progress.
|
|
21
|
+
Once the site returns a message number, known recipients appear below the message. If an automatically connected member is busy and the request must wait for its current task to finish, a one-line notice with a clock shows the member’s name and the queued message number. Hover over the notice to see how long the request has waited. The sidebar shows the room as working as soon as a request is pending for a locally woken member. The working card takes its place when the member starts. If smart scheduling needs to choose the recipient, the page shows scheduling progress.
|
|
22
22
|
|
|
23
23
|
Quick navigation on the left lists messages from users and members. Hover over a mark to preview the message or click to jump to its card. In the right sidebar's “Speaking order”, open a member row's “…” menu or right-click it and choose “Jump to latest message” (on a phone or tablet, tapping the row opens this menu; on a computer, the member card that appears when you hover over the row has the same button) to jump straight to that member's latest message or ongoing work card. On a computer, drag a member row from the right sidebar's “Speaking order” onto the messages or the composer to insert `[member Name]` at the cursor (or where you drop it, when you drop it in the composer itself) (without `@`, so it is not woken), for mentioning a member in a message without addressing it.
|
|
24
24
|
|
|
@@ -53,8 +53,8 @@ New messages wait above the composer while the intended member or room is busy.
|
|
|
53
53
|
|
|
54
54
|
- **Not waiting.** Select the send button on a queued item (on desktop it shows “Send now”, “Steer”, or “Interrupt and send”; on phones it shows the arrow icon alone); hover over it to see what it will do:
|
|
55
55
|
- The recipient is free: it goes at once.
|
|
56
|
-
- The recipient is working and its software takes interjections: this joins its current turn; it sees it right away and the work done so far stays. A message steered directly into the same task appears indented below the original user message with a “Steer” label.
|
|
57
|
-
- The recipient is working and cannot take an interjection: its turn is stopped first, and it takes this together with the interrupted work.
|
|
56
|
+
- The recipient is working and its software takes interjections: this joins its current turn; it sees it right away and the work done so far stays. A message steered directly into the same task appears indented below the original user message with a “Steer” label.
|
|
57
|
+
- The recipient is working and cannot take an interjection: its turn is stopped first, and it takes this together with the interrupted work. When all recipients were working on the same original user message, the follow-up also appears indented below that message, after the interruption record.
|
|
58
58
|
- The recipient can neither take an interjection nor be stopped: selecting it explains why and the message stays queued.
|
|
59
59
|
- **Edit or delete.** In a queued, unsent item’s menu, select “Edit message” to return it to the composer for editing, or delete it.
|
|
60
60
|
- **Reorder.** Drag queued items. On a phone, press and hold an item to move it.
|
|
@@ -63,10 +63,11 @@ New messages wait above the composer while the intended member or room is busy.
|
|
|
63
63
|
|
|
64
64
|
### 4. Stop, retry, withdraw, edit, or rewind
|
|
65
65
|
|
|
66
|
+
- A run waiting for its lease to be renewed has missed a heartbeat. It stays in the running list and returns to its previous status when the local runner renews the lease.
|
|
66
67
|
- **Stop a run.** Select “Stop” on an in-progress card, or select “Stop” from a member’s menu in the right sidebar, to stop that member’s current run. Select “Stop all” in the sidebar to stop all members and cancel requests not yet delivered. When the local service confirms process exit, the card shows “Stopped”. If it cannot confirm, it shows “Stop unconfirmed”. If an app or manual session cannot be stopped, it shows “The previous run is invalidated but may still be generating”. A late answer does not enter the conversation. The room owner can expand “Unaccepted reply” on the canceled card to inspect it.
|
|
67
68
|
- **Retry or resend.** During the delivery-failure countdown, select “Retry now” or “Stop” on the delivery card. On a run-failure card, select “Resend” to put the original user message back in the composer for confirmation and sending. If an operation failed because permission was denied, expand the card’s run report to see whether “Allow and resend” is available.
|
|
68
69
|
- **Withdraw a message.** If no member has started work on it, “Withdraw” returns the original text, files and reply to the composer. You can also withdraw the latest message after work has started. This stops that work and rewinds the conversation to the previous message. If the composer is empty, press `Esc` twice to withdraw the most recent message.
|
|
69
|
-
- **Edit and rewind.** Select “Edit” on a processed user message, change it, and send again. The message and everything after it are folded under “Rolled back”, so the AI no longer sees them. Before confirming, review how each member session will be handled. Project files stay unchanged by default. Select “Also restore files changed by the rewound runs” to restore files with a checkpoint that have not changed since the runs ended. The local service first confirms the affected runs have stopped. Check the bottom-right notice and review any skipped items manually.
|
|
70
|
+
- **Edit and rewind.** Select “Edit” on a processed user message, change it, and send again. The message and everything after it are folded under “Rolled back”, so the AI no longer sees them. Before confirming, review how each member session will be handled. Project files stay unchanged by default. Select “Also restore files changed by the rewound runs” to restore files with a checkpoint that have not changed since the runs ended. The local service first confirms the affected runs have stopped. If a folder exceeds its scan limit or rooms use up the local service’s snapshot memory budget, the run can still proceed. When you rewind several runs together and an earlier run has no checkpoint for a folder, files in that folder that cannot be restored to their starting version stay as they are and appear as skipped. Other folders with complete checkpoints can still be restored. Check the bottom-right notice and review any skipped items manually.
|
|
70
71
|
|
|
71
72
|
### 5. Private chat and interruptions during a run
|
|
72
73
|
|
|
@@ -74,7 +75,7 @@ Open private chat to see what a member is doing, redirect it midway through a ru
|
|
|
74
75
|
|
|
75
76
|
- **Open private chat.** Select “Private chat” in the sidebar, then choose a member at the top. To inspect a specific run, use the chat-bubble icon on its in-progress or answer card.
|
|
76
77
|
- **See execution details.** The private-chat page shows execution records received by the local service. Which commands, tool calls, and output are visible depends on the member’s connection. When the local service can read a Codex App member’s session before delivery, its in-progress card shows the private-chat button and the timeline and private-chat view record only the steps and outputs from that room task without pulling in unrelated messages from the same App chat; if the session cannot be read before delivery, it falls back to no progress.
|
|
77
|
-
- **Interrupt a run.** While a member works on a room task, enter a message in the private-chat composer, which prompts “Steer the current work…”. Check the page feedback to confirm the addition was delivered or queued. If the connection supports pause and resume, you can pause the run first.
|
|
78
|
+
- **Interrupt a run.** While a member works on a room task, enter a message in the private-chat composer, which prompts “Steer the current work…”. Check the page feedback to confirm the addition was delivered or queued. If the connection supports pause and resume, you can pause the run first. Send a follow-up to resume. If the software had not yet received the task when you paused it, it receives the original task, images, and follow-up together.
|
|
78
79
|
- **Chat while idle.** When the member is idle, a private-chat message is only between you and that member. It does not appear in the public room and does not wake other members.
|
|
79
80
|
|
|
80
81
|
### 6. Answer a member’s question
|
|
@@ -87,6 +88,7 @@ When a member needs you to make a decision, a question card appears above the co
|
|
|
87
88
|
|
|
88
89
|
### 7. Inspect a run and troubleshoot a room
|
|
89
90
|
|
|
91
|
+
- The host may receive an alert when a member has been quiet for a while. If the runner has confirmed that the member cannot report progress, the room skips this alert. Check the member’s original window to see whether it is still working.
|
|
90
92
|
- When a member starts a sub-agent, runs a command in the background, sets up a monitor, or sets a schedule in its own software during a run, the run card's tool-count line gains a “Background × N” item showing how many are still running (hover for a note). On that member's “Private chat” page, each turn notes when its background work started and ended (such as “Background command "…" completed · 12s”, a red dot when it failed), and a line under the input box reads “N background tasks running · view”: it opens the background panel, which lists the running items by kind with how long each has run (a schedule shows its frequency and next time) and keeps ended ones under “Earlier (N)”; press Esc or click the line again to close it. A single background task cannot be stopped there. When the member has finished its turn and only waits for that work, the card shows “Waiting for background tasks”. Claude Code, the Codex CLI, and Antigravity report background work (for Codex, only commands still running after the turn ends count); of what members' own schedules do when they fire, only the host's reaches the room (see “Scheduled report” below).
|
|
91
93
|
- When background work a member left finishes only after the member has answered, what the member delivers next still reaches the room: the card is marked “Follow-up” and responds to the original answer. A regular member's follow-up assigns no work; the host's follow-up may assign work, counted against the original task chain's round limit. A run you stopped gets no follow-up, and neither does a report that only says the background work was stopped or killed, or an intermediate event of a monitor. If the member takes on new work or you chat with it privately in the meantime, background work that has not reported yet is dropped. Only Claude Code supports follow-ups for now.
|
|
92
94
|
- With the “How work proceeds” permission, the host can set a check-in every 5–120 minutes while handling a task. Check-ins still run when the room is idle, using one round from the original task chain per idle wake. Checks while other members are working use no rounds. The schedule ends when the idle rounds run out, you select “Stop all”, or you change the host. Adding rounds does not restore a check-in that has ended. You can also select “Close” next to the check-in in the room status popover.
|
|
@@ -95,6 +97,7 @@ When a member needs you to make a decision, a question card appears above the co
|
|
|
95
97
|
- Open **Runs** in the tabs at the top of the room and select **Waterfall**. The timeline shows when each member started, how long it ran, and where it spent time waiting. Select a member's name for the run's status, start time, and duration. Select a segment to inspect the recorded details for that phase. On desktop, the phase preview opens down and to the right when space permits, and can open above or to the left near an edge. Idle stretches longer than 5 minutes are collapsed into narrow bands in **Traces**; to review the whole process at its real length, switch to **Concurrency**: at the top, **Running on its own** is the share of the span with a member at work, and **No input needed** is the share of runs started by the host, a relay or a wake-up rather than by your message, and **Longest unattended** is the longest the AI kept going after one of your messages, until the room stopped or you wrote again; one left-to-right axis with nothing collapsed, where the height above shows how many members were running at once (stacked by member color; point at a block for that run's details), idle stretches are labeled with their length, and tasks are shown as bands below. Select a task to view it in **Traces**. Both **Traces** and **Concurrency** share the same zoom and replay controls at the top right: zoom with Ctrl + wheel or the zoom buttons (pinch on phones and tablets), drag to pan when zoomed, and double-click or select **Reset** to restore the full view. Select **Replay** to play back in order (with pause, speed controls and a scrubber), and **End replay** to return to the current state; it also works while a member is still running, playing up to now. With **Follow** on, the view dynamically adjusts its zoom to frame the active runs and keeps the playback line in view; zooming manually locks your zoom level, dragging or selecting **Reset** turns **Follow** off, and selecting **Follow** re-enters dynamic auto-zoom and follow. **Show earlier runs** keeps paging back to the room's first run, and **Show all** lists every run in the room at once.
|
|
96
98
|
- To handle a permission denial, return to the conversation and check the run report on its failure card. **Allow and resend** appears when the run did not complete, the report includes a rule that can be allowed, the local service is available, and the original request can be found. Review the rule before selecting it; the original message returns to the composer for you to confirm and send. On a completed reply card, any mid-run denials fold quietly into a count you can expand to inspect, without **Allow and resend**.
|
|
97
99
|
- “Run diagnostics” shows the latest heartbeat and model or tool activity, which timeout fired, retry sources, interjection confirmations, and the workflow used at delivery. File attribution shows observed changes and tracked writes separately. Only the owner can see file paths in diagnostics. Fields without evidence show “Unknown”. Run `codiscuss execution view <ROOM_ID> <RUN_ID>` to inspect the same record in a terminal.
|
|
100
|
+
- If a file rewind reports skipped items, check `workspace_issues` in the diagnostics from `codiscuss execution view <ROOM_ID> <RUN_ID>`. Each entry identifies the main or additional folder, the affected operation (diff or checkpoint), and the reason it was skipped.
|
|
98
101
|
- If a member never woke up or an action was rejected, open **Runs → Events**. The **Event log** shows operations in time order, their outcomes, and the resulting state changes. Select a row to inspect its original record and related events. From a terminal on the local computer, run `codiscuss room events <ROOM_ID>` to read the same log.
|
|
99
102
|
|
|
100
103
|
- To troubleshoot scrolling after sending, quick navigation, run card placement, operation receipts, or annotation inputs, add `scrolldebug` to the room URL (for example, `?room=ROOM_ID&scrolldebug`). Reopen the page, reproduce the issue once, and select **Copy browser debug log** in the upper right. The log includes IDs, states, and browser measurements. It omits message, selection, and comment text. Debugging stays active until you close the tab.
|
package/docs/guide/admin.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
在“概览 → 本机 → 自建中转”一行右侧,用地区下拉框(“中转地区”)选择中转位置,默认亚太。该设置适用于管理员远程访问、经自建中转登录的托管账号和外部专家邀请。选“自动”时,Cloudflare 在最先发起连接的一方附近创建对象,通常靠近电脑的网络出口,建好后位置固定;其他选项是位置提示。服务同步设置后,电脑和已配对设备自动重连。命令行用 `codiscuss admin site region` 查看,用 `codiscuss admin site region weur` 切换到欧洲西部。
|
|
18
18
|
- **托管账号入口**(开启托管服务后显示):启停“登录入口”,开关“自建中转”或配置“Cloudflare 隧道”。
|
|
19
|
-
-
|
|
19
|
+
- **设置**:查看当前版本、“检查更新”与“更新并重启”(同步更新房间技能和隔离账号);当前版本出问题时点“其他版本”,从最近 10 个已发布版本中选一个(默认选上一个版本)“安装并重启”即可退回。旧版本不一定认得新版本写入的数据,退回后如有异常再更新到最新版、开关“登录 Windows 时自动启动”和“托管服务”(见下文“怎么操作”第 1 步),以及切换管理面板语言。在“语言 · Language”下方选“显示时区”,管理面板立即按所选时区显示时间。面板地址与主网页不同,各自保存在浏览器里。
|
|
20
20
|
- **“存储”页**:
|
|
21
21
|
- 查看本机 `.codiscuss` 数据总量(上限 10 GiB,不含语音模型)、全机草稿区占用(上限 3 GiB,单房间 1 GiB)、**房间记录与附件(`local/`)**占用、所在磁盘剩余空间与安全线,以及按房间与成员拆分的草稿占用和权限不可读条目计数;本机朗读与语音识别模型单独列出,不计入 10 GiB 上限(兼容旧目录与自定义模型目录,服务根目录为目录联接时也可正常计量)。
|
|
22
22
|
- 当 `.codiscuss` 数据达到 8 GiB 预警线时,“存储”标签显示提示圆点并弹出警告;超过上限或磁盘低于安全线时停止新的派活。总量分为五个具名目录和“其他”。“安全清理”回收已登记的失败执行临时目录、朗读缓存、无主空目录和仅剩登记文件的过期启动目录,以及本机站点已结束超过 24 小时的执行文件。清除朗读缓存后,用云端语音重听旧内容会重新合成并计费。“深度修理”先预估容量,勾选并确认后可删除含最近一天在内的已结束执行日志。
|
|
@@ -138,7 +138,7 @@ Windows 可以从托盘打开面板。macOS 和 Linux 的命令行入口见下
|
|
|
138
138
|
| 场景 | 常用命令 |
|
|
139
139
|
| --- | --- |
|
|
140
140
|
| 查看订阅利用(默认 8 周) | `codiscuss admin quota-usage [--weeks N]` |
|
|
141
|
-
| 启动、退出、重启、更新(**无需面板已运行**) | `codiscuss admin start` / `stop` / `restart` / `update [check]` |
|
|
141
|
+
| 启动、退出、重启、更新(**无需面板已运行**) | `codiscuss admin start` / `stop` / `restart` / `update [check\|versions\|<版本>]`(如 `update 0.5.65` 退回该版本) |
|
|
142
142
|
| 查看状态、启停服务、开机自启、托管服务 | `codiscuss admin status [--full]`、`service start\|stop\|restart`、`autostart on\|off`、`hosting on\|off` |
|
|
143
143
|
| 查看存储占用与清理临时文件 | `codiscuss admin storage`、`storage clean`、`storage repair`(预览)、`storage repair logs --confirm` |
|
|
144
144
|
| 让平台主理人分析占用 | `codiscuss admin storage analyze` |
|