pi-harness-runtime 1.1.14 → 1.1.15
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/CHANGELOG.md +12 -0
- package/footer-status.ts +62 -7
- package/harness/e2e/glm-quota-scraper.ts +44 -0
- package/package.json +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/write-review/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.15](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.13...v1.1.15) (2026-08-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **glm-quota:** add robust GLM quota countdown with auto-resume ([cb78a2b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cb78a2bdf5ecf79fc028030d43e3ce40767253cb))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **glm:** improve footer status display with specific 5h quota and reset time ([ab991c3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ab991c329bdb4097e77503d3d7f574edc6cdc1c4))
|
|
16
|
+
|
|
5
17
|
### [1.1.14](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.13...v1.1.14) (2026-08-24)
|
|
6
18
|
|
|
7
19
|
|
package/footer-status.ts
CHANGED
|
@@ -31,6 +31,61 @@ export function formatCountdownForDisplay(seconds: number): string {
|
|
|
31
31
|
return `${secs}s`;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Get a human-readable limit type label.
|
|
36
|
+
* Special cases for GLM's 5h quota limit.
|
|
37
|
+
*/
|
|
38
|
+
function getLimitTypeLabel(provider: string, limitType?: string): string {
|
|
39
|
+
// GLM specific: 5h quota limit
|
|
40
|
+
if (provider === "glm" && limitType === "rate_limit") {
|
|
41
|
+
return "5h quota";
|
|
42
|
+
}
|
|
43
|
+
return limitType ?? "tokens";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Format reset time for display.
|
|
48
|
+
* Converts ISO strings or human-readable times to a compact format.
|
|
49
|
+
*/
|
|
50
|
+
function formatResetTime(resetAt?: string): string {
|
|
51
|
+
if (!resetAt) return "soon";
|
|
52
|
+
|
|
53
|
+
// If it's already a short human-readable string, return as-is
|
|
54
|
+
if (/^\d+\s*(hr|min|day|d|h|m|s)/i.test(resetAt)) {
|
|
55
|
+
return resetAt;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Try to parse as ISO datetime
|
|
59
|
+
const date = new Date(resetAt);
|
|
60
|
+
if (!isNaN(date.getTime())) {
|
|
61
|
+
// Format as "Aug 25 01:47" or similar
|
|
62
|
+
const now = new Date();
|
|
63
|
+
const sameYear = date.getFullYear() === now.getFullYear();
|
|
64
|
+
const sameDay = date.toDateString() === now.toDateString();
|
|
65
|
+
|
|
66
|
+
const timeStr = date.toLocaleTimeString("en-US", {
|
|
67
|
+
hour: "2-digit",
|
|
68
|
+
minute: "2-digit",
|
|
69
|
+
hour12: false,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
if (sameDay) {
|
|
73
|
+
return `today ${timeStr}`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const month = date.toLocaleString("en-US", { month: "short" });
|
|
77
|
+
const day = date.getDate();
|
|
78
|
+
|
|
79
|
+
if (sameYear) {
|
|
80
|
+
return `${month} ${day} ${timeStr}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return `${month} ${day} ${date.getFullYear()} ${timeStr}`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return resetAt;
|
|
87
|
+
}
|
|
88
|
+
|
|
34
89
|
/**
|
|
35
90
|
* Build a TUI-signal exhaustion status line with optional countdown.
|
|
36
91
|
* This is used when a provider (like GLM) hits its limit.
|
|
@@ -41,15 +96,15 @@ export function buildExhaustionStatusLine(
|
|
|
41
96
|
countdownSeconds?: number,
|
|
42
97
|
): string {
|
|
43
98
|
const label = providerDisplayName(provider);
|
|
44
|
-
const
|
|
45
|
-
const
|
|
99
|
+
const limitTypeLabel = getLimitTypeLabel(provider, view.limitType);
|
|
100
|
+
const resetFormatted = formatResetTime(view.resets_at ?? view.h5_resets_at);
|
|
46
101
|
|
|
47
102
|
if (countdownSeconds !== undefined && countdownSeconds > 0) {
|
|
48
103
|
const countdown = formatCountdownForDisplay(countdownSeconds);
|
|
49
|
-
return `${label}: ⏳ ${countdown} (${
|
|
104
|
+
return `${label}: ⏳ ${countdown} (${limitTypeLabel})`;
|
|
50
105
|
}
|
|
51
106
|
|
|
52
|
-
return `${label}:
|
|
107
|
+
return `${label}: ${limitTypeLabel} hit, resets ${resetFormatted}`;
|
|
53
108
|
}
|
|
54
109
|
import { getProviderLabel } from "./packages/types/src/ai-providers.js";
|
|
55
110
|
import {
|
|
@@ -180,9 +235,9 @@ export function buildFooterStatusValue(
|
|
|
180
235
|
view.resets_at !== undefined ||
|
|
181
236
|
view.h5_resets_at !== undefined)
|
|
182
237
|
) {
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
return `${label}:
|
|
238
|
+
const limitTypeLabel = getLimitTypeLabel(provider, view.limitType ?? undefined);
|
|
239
|
+
const resetFormatted = formatResetTime(view.resets_at ?? view.h5_resets_at);
|
|
240
|
+
return `${label}: ${limitTypeLabel} hit, resets ${resetFormatted}`;
|
|
186
241
|
}
|
|
187
242
|
|
|
188
243
|
// Continuous data path: providers with continuous scrape (MiniMax has 5h+weekly, OpenAI has weekly-only)
|
|
@@ -407,6 +407,50 @@ export class GLMQuotaScraper {
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
+
/**
|
|
411
|
+
* Parse reset time from GLM 429 error message.
|
|
412
|
+
* Extracts the reset timestamp from messages like:
|
|
413
|
+
* '{"code":"1308","message":"Usage limit reached for 5 hour. Your limit will reset at 2026-08-25 01:47:16"}'
|
|
414
|
+
*/
|
|
415
|
+
export function parseGLMErrorResetTime(errorMessage: string): string | null {
|
|
416
|
+
// Try to find the JSON object in the message
|
|
417
|
+
const jsonMatch = errorMessage.match(/\{[^{}]*\}/);
|
|
418
|
+
if (jsonMatch) {
|
|
419
|
+
try {
|
|
420
|
+
const json = JSON.parse(jsonMatch[0]);
|
|
421
|
+
if (json.code === 1308 && json.message) {
|
|
422
|
+
// Extract datetime from message
|
|
423
|
+
const datetimeMatch = json.message.match(
|
|
424
|
+
/reset at (\d{4}-\d{2}-\d{2}[T ]?\d{2}:\d{2}:\d{2})/i,
|
|
425
|
+
);
|
|
426
|
+
if (datetimeMatch) {
|
|
427
|
+
const datetimeStr = datetimeMatch[1].replace(" ", "T");
|
|
428
|
+
const date = new Date(datetimeStr);
|
|
429
|
+
if (!isNaN(date.getTime())) {
|
|
430
|
+
return date.toISOString();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
} catch {
|
|
435
|
+
// Not JSON, try plain text parsing
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// Fallback: try plain text parsing
|
|
440
|
+
const plainMatch = errorMessage.match(
|
|
441
|
+
/reset at (\d{4}-\d{2}-\d{2}[T ]?\d{2}:\d{2}:\d{2})/i,
|
|
442
|
+
);
|
|
443
|
+
if (plainMatch) {
|
|
444
|
+
const datetimeStr = plainMatch[1].replace(" ", "T");
|
|
445
|
+
const date = new Date(datetimeStr);
|
|
446
|
+
if (!isNaN(date.getTime())) {
|
|
447
|
+
return date.toISOString();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
return null;
|
|
452
|
+
}
|
|
453
|
+
|
|
410
454
|
/**
|
|
411
455
|
* Integration helper for index.ts
|
|
412
456
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/capability-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"description": "Capability Registry for pi-harness-runtime — tracks model capabilities and enables capability-based routing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/provider-router",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"description": "Enhanced Provider Router for pi-harness-runtime — intelligent routing with capabilities, costs, and quotas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/provider-router.js",
|