-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coder-sin-qwen-memory.json
More file actions
130 lines (130 loc) · 8.44 KB
/
Copy path.coder-sin-qwen-memory.json
File metadata and controls
130 lines (130 loc) · 8.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{
"version": 1,
"updatedAt": "2026-04-27T06:17:36.908Z",
"contexts": {
"df3a685f-409e-4b26-8985-a7e5b89cae0c": {
"repoKey": "https://github.com/OpenSIN-AI/OpenSIN-documentation",
"sessionId": "df3a685f-409e-4b26-8985-a7e5b89cae0c",
"repoUrl": "https://github.com/OpenSIN-AI/OpenSIN-documentation",
"branch": "main",
"head": "c5d823780bb17df5f80e30a2a8faed2ddbe9892a",
"dirty": true,
"updatedAt": "2026-04-27T06:17:36.908Z",
"trace": {
"runId": "df3a685f-409e-4b26-8985-a7e5b89cae0c",
"traceId": "df3a685f-409e-4b26-8985-a7e5b89cae0c",
"spanId": "701c2b1b-0d82-446c-baf6-d3fcbca912ce",
"parentSpanId": "",
"sessionId": "df3a685f-409e-4b26-8985-a7e5b89cae0c"
},
"lastMessageId": "72f59340-094c-44d5-8215-7f2cdc2118f9",
"previousMessageId": "",
"latestPrompt": "Review the coder-SIN-Qwen relay code and suggest one concrete improvement to make it more robust.",
"latestSummary": "Die Implementierung eines Circuit Breakers mit exponentiellem Backoff und Jitter verhindert Kaskadenfehler bei Zielsystem-Ausfällen und stabilisiert die Relay-Latenz unter Last.",
"latestStatus": "",
"latestDecision": {
"timestamp": "2026-04-27T06:17:36.908Z",
"status": "structured-json",
"prompt": "Review the coder-SIN-Qwen relay code and suggest one concrete improvement to make it more robust.",
"summary": "Die Implementierung eines Circuit Breakers mit exponentiellem Backoff und Jitter verhindert Kaskadenfehler bei Zielsystem-Ausfällen und stabilisiert die Relay-Latenz unter Last."
},
"latestReview": {
"pass": true,
"score": 1,
"violations": [],
"fluff_ratio": 0,
"retry_action": "accept",
"cleaned_text": "Die Implementierung eines Circuit Breakers mit exponentiellem Backoff und Jitter verhindert Kaskadenfehler bei Zielsystem-Ausfällen und stabilisiert die Relay-Latenz unter Last. src/relay/sin-qwen-relay.ts typescript import { randomBytes } from 'node:crypto'; export interface RelayConfig { targetUrl: string; maxRetries: number; baseDelayMs: number; timeoutMs: number; circuitBreakerThreshold: number; } export interface RelayResponse { status: number; body: unknown; headers: Record<string, string>; } class CircuitBreaker { private failures = 0; private readonly threshold: number; private resetTimer: ReturnType<typeof setTimeout> | null = null; private state: 'CLOSED' | 'OPEN' = 'CLOSED'; constructor(threshold: number) { this.threshold = threshold; } canExecute(): boolean { return this.state === 'CLOSED'; } recordSuccess(): void { this.failures = 0; this.state = 'CLOSED'; } recordFailure(): void { this.failures++; if (this.failures >= this.threshold) { this.state = 'OPEN'; this.resetTimer = setTimeout(() => { this.state = 'CLOSED'; this.failures = 0; }, 60_000); } } destroy(): void { if (this.resetTimer) clearTimeout(this.resetTimer); } } export async function relayRequest( payload: Record<string, unknown>, config: RelayConfig ): Promise<RelayResponse> { const breaker = new CircuitBreaker(config.circuitBreakerThreshold); try { for (let attempt = 0; attempt <= config.maxRetries; attempt++) { if (!breaker.canExecute()) { throw new Error('Circuit breaker open: relay temporarily disabled'); } const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), config.timeoutMs); try { const response = await fetch(config.targetUrl, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Request-ID': randomBytes(16).toString('hex'), }, body: JSON.stringify(payload), signal: controller.signal, }); clearTimeout(timeoutId); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } const body = await response.json(); const headers: Record<string, string> = {}; response.headers.forEach((v, k) => (headers[k] = v)); breaker.recordSuccess(); return { status: response.status, body, headers }; } catch (error) { clearTimeout(timeoutId); breaker.recordFailure(); if (attempt === config.maxRetries) { throw new Error(`Relay failed after ${config.maxRetries} retries`, { cause: error }); } const jitter = Math.random() * 1000; const delay = Math.min(config.baseDelayMs * 2 ** attempt + jitter, 30_000); await new Promise((resolve) => setTimeout(resolve, delay)); } } } finally { breaker.destroy(); } throw new Error('Unreachable relay execution path'); }",
"metadata": {
"checked_at": "2026-04-27T06:17:36.907Z",
"reply_length": 3057,
"plan": "structured-json",
"completion_status": "stable",
"completion_source": "ui_completion_confirmation"
}
},
"constraints": [
"Use the provided repo and file URLs when code context matters.",
"If the target repo is private or inaccessible by URL, use attached local files instead of relying on repo URLs.",
"Image files are local-only; do not expect Qwen to inspect them directly.",
"Prefer official references over guessed behavior."
],
"completionCriteria": [
"Keep the recommendation aligned with the current repo state.",
"Return production-ready output only."
],
"references": [
{
"label": "Repository URL",
"url": "https://github.com/OpenSIN-AI/OpenSIN-documentation",
"reason": "Use for repo-wide browsing and linked file context."
},
{
"label": "Node.js API docs",
"url": "https://nodejs.org/docs/latest/api/",
"reason": "Authoritative Node runtime and standard-library reference."
},
{
"label": "GitHub Actions docs",
"url": "https://docs.github.com/actions",
"reason": "Official CI/CD and workflow guidance."
},
{
"label": "OpenCode documentation",
"url": "https://opencode.ai/docs",
"reason": "Official OpenCode documentation for commands, config, and workflows."
}
],
"fileReferences": [
{
"path": "create-a2a-sin-coder_header.md",
"url": "https://github.com/OpenSIN-AI/OpenSIN-documentation/blob/c5d823780bb17df5f80e30a2a8faed2ddbe9892a/create-a2a-sin-coder_header.md"
},
{
"path": "create-a2a-sin-coder_new.md",
"url": "https://github.com/OpenSIN-AI/OpenSIN-documentation/blob/c5d823780bb17df5f80e30a2a8faed2ddbe9892a/create-a2a-sin-coder_new.md"
},
{
"path": ".opencode/KNOWLEDGE_CHROME_LOGIN_FLOW.md",
"url": ""
},
{
"path": ".pcpm/active-context.json",
"url": "https://github.com/OpenSIN-AI/OpenSIN-documentation/blob/c5d823780bb17df5f80e30a2a8faed2ddbe9892a/.pcpm/active-context.json"
},
{
"path": ".pcpm/plan/latest.json",
"url": "https://github.com/OpenSIN-AI/OpenSIN-documentation/blob/c5d823780bb17df5f80e30a2a8faed2ddbe9892a/.pcpm/plan/latest.json"
},
{
"path": "CEO_TEST.txt",
"url": "https://github.com/OpenSIN-AI/OpenSIN-documentation/blob/c5d823780bb17df5f80e30a2a8faed2ddbe9892a/CEO_TEST.txt"
},
{
"path": ".vitepress/theme/index.js",
"url": "https://github.com/OpenSIN-AI/OpenSIN-documentation/blob/c5d823780bb17df5f80e30a2a8faed2ddbe9892a/.vitepress/theme/index.js"
},
{
"path": "docs/.vitepress/theme/index.ts",
"url": "https://github.com/OpenSIN-AI/OpenSIN-documentation/blob/c5d823780bb17df5f80e30a2a8faed2ddbe9892a/docs/.vitepress/theme/index.ts"
}
],
"decisionHistory": [
{
"timestamp": "2026-04-27T06:17:36.908Z",
"status": "structured-json",
"prompt": "Review the coder-SIN-Qwen relay code and suggest one concrete improvement to make it more robust.",
"summary": "Die Implementierung eines Circuit Breakers mit exponentiellem Backoff und Jitter verhindert Kaskadenfehler bei Zielsystem-Ausfällen und stabilisiert die Relay-Latenz unter Last."
}
],
"history": [
{
"messageId": "72f59340-094c-44d5-8215-7f2cdc2118f9",
"timestamp": "2026-04-27T06:17:36.908Z",
"prompt": "Review the coder-SIN-Qwen relay code and suggest one concrete improvement to make it more robust.",
"summary": "Die Implementierung eines Circuit Breakers mit exponentiellem Backoff und Jitter verhindert Kaskadenfehler bei Zielsystem-Ausfällen und stabilisiert die Relay-Latenz unter Last."
}
]
}
}
}