@piagent/platform 1.14.0 → 1.15.0

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -1
  3. package/README.vi.md +1 -1
  4. package/docs/command-reference-vietnamese.md +2 -2
  5. package/docs/distribution-standard.md +6 -6
  6. package/docs/languages.json +2 -2
  7. package/docs/operator-manual-vietnamese.md +7 -7
  8. package/docs/publishing-for-teams.md +1 -0
  9. package/docs/release-install-policy.md +2 -2
  10. package/docs/team-onboarding.md +2 -2
  11. package/docs-site/architecture.html +1 -1
  12. package/docs-site/benchmark.html +1 -1
  13. package/docs-site/commands.html +1 -1
  14. package/docs-site/content/en/index.html +4 -4
  15. package/docs-site/content/en/whats-new.html +12 -0
  16. package/docs-site/content/index.html +4 -4
  17. package/docs-site/content/whats-new.html +12 -0
  18. package/docs-site/context-engine.html +1 -1
  19. package/docs-site/ecosystem.html +1 -1
  20. package/docs-site/en/architecture.html +1 -1
  21. package/docs-site/en/benchmark.html +1 -1
  22. package/docs-site/en/commands.html +1 -1
  23. package/docs-site/en/context-engine.html +1 -1
  24. package/docs-site/en/ecosystem.html +1 -1
  25. package/docs-site/en/index.html +5 -5
  26. package/docs-site/en/mcp-approval.html +1 -1
  27. package/docs-site/en/mcp-auth.html +1 -1
  28. package/docs-site/en/mcp-servers.html +1 -1
  29. package/docs-site/en/mcp.html +1 -1
  30. package/docs-site/en/permissions.html +1 -1
  31. package/docs-site/en/profiles.html +1 -1
  32. package/docs-site/en/quickstart.html +1 -1
  33. package/docs-site/en/runtime.html +1 -1
  34. package/docs-site/en/scope.html +1 -1
  35. package/docs-site/en/security.html +1 -1
  36. package/docs-site/en/team.html +1 -1
  37. package/docs-site/en/whats-new.html +13 -1
  38. package/docs-site/en/windows.html +1 -1
  39. package/docs-site/en/workflows.html +1 -1
  40. package/docs-site/index.html +5 -5
  41. package/docs-site/mcp-approval.html +1 -1
  42. package/docs-site/mcp-auth.html +1 -1
  43. package/docs-site/mcp-servers.html +1 -1
  44. package/docs-site/mcp.html +1 -1
  45. package/docs-site/permissions.html +1 -1
  46. package/docs-site/profiles.html +1 -1
  47. package/docs-site/quickstart.html +1 -1
  48. package/docs-site/runtime.html +1 -1
  49. package/docs-site/scope.html +1 -1
  50. package/docs-site/security.html +1 -1
  51. package/docs-site/team.html +1 -1
  52. package/docs-site/whats-new.html +13 -1
  53. package/docs-site/windows.html +1 -1
  54. package/docs-site/workflows.html +1 -1
  55. package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
  56. package/package.json +1 -1
  57. package/packages/piagent-core/managed/broker-client.mjs +7 -1
  58. package/packages/piagent-core/managed/helper-run.mjs +2 -2
  59. package/packages/piagent-core/managed/sandbox-diagnostic.mjs +3 -0
  60. package/packages/piagent-core/managed/session.mjs +2 -2
  61. package/packages/piagent-core/managed/tool-boundary.mjs +5 -1
  62. package/packages/piagent-core/package.json +1 -1
  63. package/packages/piagent-core/runtime/managed-failure.mjs +9 -1
  64. package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-CyT2G1H2.js → MarkdownMessage-PIk4Femi.js} +1 -1
  65. package/packages/piagent-webui/dist/client/assets/{index-BBEa7Ger.js → index-DeCt-FaN.js} +12 -12
  66. package/packages/piagent-webui/dist/client/index.html +1 -1
  67. package/packages/piagent-webui/gateway/pi-host.ts +16 -2
  68. package/scripts/update-global.mjs +7 -1
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/windows" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/windows" hreflang="en" lang="en" aria-current="true">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · EN</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · EN</span>
34
34
  <nav class="language-switch" aria-label="Language">
35
35
  <a class="language-option" href="/workflows" hreflang="vi" lang="vi">VI</a>
36
36
  <a class="language-option current" href="/en/workflows" hreflang="en" lang="en" aria-current="true">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/" hreflang="en" lang="en">EN</a>
@@ -94,7 +94,7 @@
94
94
  <main>
95
95
  <div class="content-shell" data-article>
96
96
  <section class="hero">
97
- <p class="eyebrow">Piagent 1.14.0</p>
97
+ <p class="eyebrow">Piagent 1.15.0</p>
98
98
  <h1>Coding agent cho cả team, kiểm tra từng bước.</h1>
99
99
  <p>
100
100
  Một dashboard cho Terminal và trình duyệt. Dùng model bằng tài khoản của bạn, hoặc model của công ty qua Agent Watch và Agent Studio. Guard kiểm tra từng tool call; ở chế độ công ty, Harness của team tự yêu cầu chạy check, cho subagent review và báo kết quả ngay dưới câu trả lời.
@@ -108,7 +108,7 @@
108
108
  <div class="hero-actions">
109
109
  <a class="button primary" href="/quickstart">Bắt đầu</a>
110
110
  <a class="button" href="/ecosystem">Hệ sinh thái</a>
111
- <a class="button" href="/whats-new">Có gì mới trong 1.14.0</a>
111
+ <a class="button" href="/whats-new">Có gì mới trong 1.15.0</a>
112
112
  <a class="button" href="/commands">Xem command</a>
113
113
  </div>
114
114
  </section>
@@ -184,9 +184,9 @@ piagent-setup</code></pre>
184
184
  <h2 id="bat-dau-tu-dau">Bắt đầu từ đâu</h2>
185
185
  <div class="card-grid">
186
186
  <a class="doc-card" href="/whats-new">
187
- <span class="card-kicker">Bản 1.14.0</span>
187
+ <span class="card-kicker">Bản 1.15.0</span>
188
188
  <h3>Có gì mới</h3>
189
- <p>Cập nhật giữ model bạn đã chọn; ở 1.13: cuộc trò chuyện giữ chỗ đang đọc, chữ của agent có định dạng, Piagent trên Windows qua WSL2: sandbox công ty bằng bubblewrap và Agent Watch cho Windows; ở 1.12: @ chọn file và folder trên máy, skill và command dùng bằng /, nhánh cuộc trò chuyện công ty gửi được tin nhắn.</p>
189
+ <p>Subagent bị từ chối nói đúng lý do, lệnh chạy lâu không bị dừng; ở 1.14: cập nhật giữ model bạn đã chọn; ở 1.13: cuộc trò chuyện giữ chỗ đang đọc, chữ của agent có định dạng, Piagent trên Windows qua WSL2: sandbox công ty bằng bubblewrap và Agent Watch cho Windows; ở 1.12: @ chọn file và folder trên máy, skill và command dùng bằng /, nhánh cuộc trò chuyện công ty gửi được tin nhắn.</p>
190
190
  </a>
191
191
  <a class="doc-card" href="/ecosystem">
192
192
  <span class="card-kicker">Get started</span>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/mcp-approval" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/mcp-approval" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/mcp-auth" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/mcp-auth" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/mcp-servers" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/mcp-servers" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/mcp" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/mcp" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/permissions" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/permissions" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/profiles" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/profiles" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/quickstart" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/quickstart" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/runtime" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/runtime" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/scope" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/scope" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/security" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/security" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/team" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/team" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/whats-new" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/whats-new" hreflang="en" lang="en">EN</a>
@@ -104,6 +104,18 @@
104
104
  <h1>Bản 1.9.0: nói việc bằng lời, Harness của team kiểm tra</h1>
105
105
  <p>Bỏ task contract và lệnh workflow. Chế độ công ty tự yêu cầu check và review; nút Dừng, lệnh có mạng theo lần duyệt và thẻ duyệt dễ đọc hơn.</p>
106
106
  </div>
107
+ <section class="section">
108
+ <p class="section-kicker">v1.15.0 · 2026-10-07</p>
109
+ <h2 id="v1-15-0">Subagent bị từ chối nói đúng lý do</h2>
110
+ <p class="section-lead">Khi Studio từ chối một subagent công ty, Piagent nay báo lý do của Studio thay vì luôn báo "cấu hình vừa thay đổi". Ví dụ: không tài khoản AI nào của công ty phục vụ model của vai trò này, và quản trị viên cần gắn hoặc bật một tài khoản. Cần Agent Watch 0.15.0; với Studio 0.19.0, subagent thiếu tài khoản lúc bắt đầu lượt sẽ tự lấy model đang phục vụ khi được gọi.</p>
111
+ <ul>
112
+ <li>Lệnh in nhiều và chạy lâu (bộ test, build) không còn bị dừng với <span class="inline-code">managed-tool-output-too-large</span>.</li>
113
+ <li>Lệnh ghi vào <span class="inline-code">/tmp</span> ở chế độ công ty được chỉ sang <span class="inline-code">$TMPDIR</span> hoặc thư mục project.</li>
114
+ <li><span class="inline-code">piagent-update</span> chạy từ <span class="inline-code">npm exec</span> cài helper lâu dài; trên Windows, Pi được tìm thấy trong npm prefix tùy chỉnh.</li>
115
+ </ul>
116
+ <p>Cập nhật từ 1.14.x không cần nhập lại cấu hình trong Agent Watch.</p>
117
+ </section>
118
+
107
119
  <section class="section">
108
120
  <p class="section-kicker">v1.14.0 · 2026-10-06</p>
109
121
  <h2 id="v1-14-0">Cập nhật giữ lựa chọn model của bạn</h2>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/windows" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/windows" hreflang="en" lang="en">EN</a>
@@ -30,7 +30,7 @@
30
30
  <span>Pi Agent Platform</span>
31
31
  </a>
32
32
  <div class="top-actions">
33
- <span class="pill"><span class="pill-dot"></span>v1.14.0 docs · VI</span>
33
+ <span class="pill"><span class="pill-dot"></span>v1.15.0 docs · VI</span>
34
34
  <nav class="language-switch" aria-label="Ngôn ngữ">
35
35
  <a class="language-option current" href="/workflows" hreflang="vi" lang="vi" aria-current="true">VI</a>
36
36
  <a class="language-option" href="/en/workflows" hreflang="en" lang="en">EN</a>
@@ -256,8 +256,8 @@
256
256
  },
257
257
  {
258
258
  "path": "tests",
259
- "fileCount": 522,
260
- "sha256": "8fc4dfb3f75d7270c03298afec804cba5f1a849cbf06f8dd352480ee50e558b7"
259
+ "fileCount": 523,
260
+ "sha256": "7a915f36ce5d1c156d838eb5bbeba84db83e26fc092b77328006aecf6b53b3b8"
261
261
  }
262
262
  ],
263
263
  "custodianComparisonRules": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piagent/platform",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -26,7 +26,13 @@ export class ManagedBrokerClient {
26
26
  const result = JSON.parse(line), item = this.#pending.get(result.id);
27
27
  if (!item) throw Error('unexpected-broker-response');
28
28
  clearTimeout(item.timer); this.#pending.delete(result.id);
29
- if (result.error) item.reject(Error(`managed-broker:${String(result.error).replace(/[^a-zA-Z_]/g, '').slice(0, 80)}`));
29
+ if (result.error) {
30
+ // Agent Watch's coarse error stays the message (start and renewal
31
+ // decide on it); Studio's own reason rides along for the member.
32
+ const error = Error(`managed-broker:${String(result.error).replace(/[^a-zA-Z_]/g, '').slice(0, 80)}`);
33
+ if (typeof result.studio_code === 'string' && /^[a-z0-9_]{1,64}$/.test(result.studio_code)) error.studioCode = result.studio_code;
34
+ item.reject(error);
35
+ }
30
36
  else item.resolve(result.result);
31
37
  } catch { this.#child.kill(); fail(); }
32
38
  }
@@ -6,7 +6,7 @@
6
6
  import { ManagedToolBoundary } from './tool-boundary.mjs';
7
7
  import { managedResourceLoader } from './resource-loader.mjs';
8
8
  import { shareGrant, releaseGrant } from './grant-share.mjs';
9
- import { describeFailure, failureCode } from '../runtime/managed-failure.mjs';
9
+ import { describeFailure, failureCode, failureText } from '../runtime/managed-failure.mjs';
10
10
  import { reviewParts, mergeReviews, REVIEW_PARALLEL } from './patch-snapshot.mjs';
11
11
  import { reviewFindings, briefIssues } from './workflow.mjs';
12
12
  import { anchorText, relayObjection, recordVerdicts } from './objections.mjs';
@@ -48,7 +48,7 @@ async function helperAttempt(managed, role, task, signal, harness, snapshot, par
48
48
  managed.helperCalls.set(role, (managed.helperCalls.get(role) ?? 0) + 1);
49
49
  try { verifyGrant(grant, managed.manifest, role); }
50
50
  catch (error) { try { await managed.broker.request('close', { role }); } catch { /* closes with the run */ } throw error; }
51
- } catch (error) { throw Error(`managed-helper-failed: ${describeFailure(role, error?.message)}`); }
51
+ } catch (error) { throw Error(`managed-helper-failed: ${describeFailure(role, failureText(error))}`); }
52
52
  let boundary;
53
53
  const sessions = new Set();
54
54
  try {
@@ -10,6 +10,9 @@ export function sandboxDiagnostic(message, { network = false, isolated = false }
10
10
  if(network&&!DENIAL.test(text)&&OFFLINE.test(text))return 'managed-network-unreachable: Lệnh đã được duyệt và chạy có mạng nhưng không tới được host (máy đang offline, cần VPN/proxy công ty, hoặc sai tên host). Không xin duyệt lại cùng lệnh; báo người dùng lỗi mạng này.\n'+text;
11
11
  if(!DENIAL.test(text)&&OFFLINE.test(text))return 'managed-network-blocked: Lệnh bash thường không có mạng trong chế độ công ty. Nếu lệnh thật sự cần mạng (cài package, tải dữ liệu), dùng run_with_network để người dùng duyệt đúng lệnh đó.\n'+text;
12
12
  if(!DENIAL.test(text))return text;
13
+ // /tmp is shared by every process on the Mac, so it stays read-only; each
14
+ // command has its own temporary folder in $TMPDIR (Linux: a private /tmp).
15
+ if(/(?:^|[\s'"=:(])\/(?:private\/)?tmp\//.test(text))return 'managed-sandbox-denied: /tmp chỉ được đọc trong chế độ công ty. Ghi file tạm (log, kết quả test) vào "$TMPDIR" (thư mục tạm riêng của lệnh, ví dụ "$TMPDIR/test.log") hoặc trong project. Không tự chạy lại bên ngoài sandbox.\n'+text;
13
16
  return 'managed-sandbox-denied: Công cụ bị giới hạn quyền trong chế độ công ty (hoặc quyền file của hệ điều hành). Keychain và file chứa credential như .env/.npmrc bị chặn. Lệnh cần mạng (cài package, tải dữ liệu) dùng run_with_network để xin duyệt; git fetch origin dùng fetch_origin. Không tự chạy lại bên ngoài sandbox.\n'+text;
14
17
  }
15
18
 
@@ -11,7 +11,7 @@ import { shareGrant, releaseGrant } from './grant-share.mjs';
11
11
  import { managedThinkingLevels, nearestLevel } from './capabilities.mjs';
12
12
  import { nativeManagedModel, isVendor, piProvider, studioAPI, studioPath } from './native-catalog.mjs';
13
13
  import { repositoryFetchPlan, executeRepositoryFetch } from './repository-operation.mjs';
14
- import { describeFailure, failureCode } from '../runtime/managed-failure.mjs';
14
+ import { describeFailure, failureCode, failureText } from '../runtime/managed-failure.mjs';
15
15
  import { wrapRoleStreams } from './request-stream.mjs';
16
16
  import { runHelper } from './helper-run.mjs';
17
17
  import { askTool } from './member-questions.mjs';
@@ -268,7 +268,7 @@ export class ManagedSession {
268
268
  });
269
269
  self.run = new RunProcess(workflowPolicy(self.manifest), { request: text, complex: taskClass(text) === 'complex', checks: self.checks });
270
270
  self.run.startDigest = pendingBaseline(manager) ?? await self.digest();
271
- } catch (error) { self.preflight = describeFailure('main', error?.message); }
271
+ } catch (error) { self.preflight = describeFailure('main', failureText(error)); }
272
272
  self.activePrompt = true;
273
273
  })();
274
274
  try { await self.starting; } finally { self.starting = null; }
@@ -313,7 +313,11 @@ export class ManagedToolBoundary {
313
313
  signal?.addEventListener('abort', abort, { once: true });
314
314
  child.stdin.on('error', () => {});
315
315
  child.stdout.on('data', chunk => {
316
- bytes += chunk.length;
316
+ // The cap is per message, not per command: a noisy command streams a
317
+ // progress update (the output's last 50KB) every 100ms, so a running
318
+ // total would stop any build or test that prints for ~25 seconds.
319
+ const newline = chunk.lastIndexOf(10);
320
+ bytes = newline < 0 ? bytes + chunk.length : chunk.length - newline - 1;
317
321
  if (bytes > MAX_WIRE_BYTES) { failure = new Error('managed-tool-output-too-large'); terminate(); return; }
318
322
  pending += decoder.write(chunk);
319
323
  for (;;) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piagent/core",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "license": "MIT",
@@ -35,7 +35,8 @@ const CODES = {
35
35
  policy_denied: ['policy', 'this key may not use this model, thinking level or output size'],
36
36
  thinking_level_unavailable: ['policy', 'this thinking level is not available for the harness'],
37
37
  harness_model_unsupported: ['policy', 'the harness uses a model Studio cannot run'],
38
- harness_profile_unavailable: ['policy', 'the team has no usable harness'],
38
+ harness_profile_unavailable: ['policy', "the team's harness has no model for this role"],
39
+ harness_route_unavailable: ['provider-limit', "no company model account serves this role's model for the team right now; an administrator has to link or enable one in Studio"],
39
40
  execution_capability_unavailable: ['policy', 'no company model account can run this model'],
40
41
  session_account_unavailable_start_new_session: ['new-session', "this conversation's model account is gone"],
41
42
  run_state_conflict: ['config-changed', 'this run was closed or replaced'],
@@ -149,6 +150,13 @@ export function failureCode(raw) {
149
150
  return 'managed-request-failed';
150
151
  }
151
152
 
153
+ // An error's text with Studio's own reason for a refusal Agent Watch passed
154
+ // on (error.studioCode), in the shape failureCode reads first.
155
+ export function failureText(error) {
156
+ const text = String(error?.message ?? error ?? '');
157
+ return typeof error?.studioCode === 'string' ? `${text} {"code":"${error.studioCode}"}` : text;
158
+ }
159
+
152
160
  // "Agent Watch main agent: <what failed> [code] (request <id>)". The role says
153
161
  // who failed; the model behind it is the harness's business, not the reader's.
154
162
  export function describeFailure(role, raw) {