feat: add proxy configuration support for all network access - #9

Closed
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd
Closed

feat: add proxy configuration support for all network access#9
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd

Conversation

@t1tuesr

Copy link
Copy Markdown

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) are injected into the Claude Code subprocess, and Electron's session proxy is also set for renderer network requests.

https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings
page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY,
NO_PROXY) are injected into the Claude Code subprocess, and Electron's
session proxy is also set for renderer network requests.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
A minimal HTTP CONNECT proxy that logs all requests passing through it,
making it easy to confirm Claude API traffic is routed via the proxy.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
@t1tuesrt1tuesr closed this Feb 7, 2026
@t1tuesr
t1tuesr deleted the claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd branch February 7, 2026 15:39
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt #9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt #8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt #9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 op7418#2 补充连续水位推进机制
- 新增决策 op7418#9(图片接收)和 op7418#10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt op7418#9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt op7418#8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt op7418#9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
User mode change: "internal slice order preserved, external single
delivery; stop only after Phase 2 is done; Codex review takes the
batch." This commit lands slices 2a–2e together with all post-
review hardenings (Widget wire-format single source, Expected
Differences Ledger, runtimeHints prose ban).
Internal slice walk
2a — context-compiler.ts (NEW)
Pure function `compileContext(input): CompiledContext`. No IO,
no provider calls. Resolves enabledCapabilities (null = catalog
live default), looks up exposure for the calling runtime, emits
capabilityFragments + artifactContracts + memory + workspace +
toolDescriptors + runtimeHints + budget + systemPromptText +
diagnostics. Hard contracts: artifactContract before capability
in the assembled prompt; fragmentId uniqueness; cross-runtime
fragment text identity; compile-time FAIL if a capability
fragment text contains an artifact contract canonicalJson
(wire-format dedup); compile-time FAIL if load-bearing fragments
exceed budget. runtimeHints types strictly ID/refs/adapter
options — no prose, no template literals.
2b — expected-differences.ts (NEW)
Drift ledger. Initial 4 entries from slice 7b tech-debt. Three
slice_2d entries consumed by this commit (see 2d below); the
one remaining `follow_up` is image_generation MediaBlock shape
(non-prompt, future slice).
2c — ClaudeCode SDK (claude-client.ts) source-pin only
The SDK path has always imported MCP canonicals directly
(memory-search-mcp, notification-mcp, media-import-mcp,
cli-tools-mcp, dashboard-mcp) — no paraphrase ever existed.
Slice 2c codifies this with a contract test: claude-client.ts
must not import capability prompts from builtin-tools/* and
must not declare its own _SYSTEM_PROMPT scalars.
2d — Native Runtime (builtin-tools/*) re-export MCP canonicals
`memory-search.ts` now `export const MEMORY_SEARCH_SYSTEM_PROMPT =
CANONICAL_MEMORY_SEARCH_SYSTEM_PROMPT` (imported from
memory-search-mcp.ts). Same pattern for `notification.ts`
(NOTIFICATION_SYSTEM_PROMPT = NOTIFICATION_MCP_SYSTEM_PROMPT)
and `media.ts` (MEDIA_SYSTEM_PROMPT = MEDIA_MCP_SYSTEM_PROMPT
from media-import-mcp.ts). Three ledger entries removed in
sync.
2e — Codex bridge (builtin-bridge.ts + unified-adapter.ts)
Bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four declarations
deleted). `createCodePilotBuiltinTools().systemPrompt` is
permanently `''`. `unified-adapter.ts` now calls
`compileContext({ runtimeId: 'codex_runtime', ... })` and feeds
`compiled.systemPromptText` to Codex's `instructions`. A new
helper `capabilitiesFromBridgeToolNames` maps the bridge's
mounted tool names back to capability ids so the compiler's
enabledCapabilities aligns with what the bridge actually
exposes (workspace-gated memory tools naturally drop out when
workspacePath is empty).
Slice 2c Widget wire-format single source (review revision op7418#1)
WIDGET_SYSTEM_PROMPT in widget-guidelines.ts no longer
template-literal-embeds `${WIDGET_WIRE_FORMAT_SPEC}`. The
artifactContract is now the sole holder of the wire-format spec
+ canonical JSON. Compiler's `detectWireFormatDuplication` sanity
check throws at compile time if any capability fragment text
contains the artifact contract canonicalJson — that's the forcing
function preventing the spec from being re-injected.
Three regression pins enforce single occurrence in the compiled
prompt: CANONICAL_SHOW_WIDGET_JSON × 1, "FINAL OUTPUT FORMAT —
non-negotiable" × 1, WIDGET_WIRE_FORMAT_SPEC × 1.
runtimeHints boundary (review revision op7418#3)
ClaudeCodeHints / NativeHints / CodexProxyHints types now carry
only IDs (mcp server names, tool keys, builtin tool name set) +
adapter options (stopWhen, stepCount, passthroughToolTypes).
Tests pin: type-level (no string field > 64 chars, no newline,
no Markdown markers), runtime-level (scan all string values for
prose), source-grep (CodexProxyHints type definition can't
contain `promptOverride` / `promptExtra` / `widgetPrompt` / etc).
Tests
New harness-context-compiler.test.ts (23 pins): catalog hygiene,
Widget wire-format single source (op7418#10), ordering, budget
enforcement, cross-runtime fragment identity (op7418#9), tool
descriptors, runtimeHints boundary (op7418#11), Expected Differences
Ledger consistency (op7418#12), JSON parseability of every artifact
contract.
New harness-context-compiler-equivalence.test.ts (9 pins):
compiler source reachability, runtime drift honesty,
ledger/slice ownership correctness, "post-slice-2d: Native
ledger holds only the follow_up MediaBlock entry".
Updated harness-capability-contract.test.ts: drift pins now
check (a) bridge holds no local _PROMPT scalars, (b) Native
builtin-tools re-export MCP canonicals, (c) unified-adapter
imports compileContext + consumes systemPromptText, (d)
claude-client.ts doesn't import from builtin-tools/* and
doesn't declare own _SYSTEM_PROMPT.
Updated codex-widget-format-contract.test.ts: the "WIDGET_SYSTEM_PROMPT
embeds WIDGET_WIRE_FORMAT_SPEC" and "appears inside
WIDGET_SYSTEM_PROMPT" pins are flipped — slice 2c REMOVED the
embed; the new pins verify the compiler-side import line.
Updated codex-builtin-bridge.test.ts: tests previously asserting
`bridge.systemPrompt` contained capability tags now assert it
equals `''` (bridge is no longer the prompt-assembly point).
Verification
CODEX_DISABLED=1 npx tsx --test \
src/__tests__/unit/harness-context-compiler.test.ts \
src/__tests__/unit/harness-context-compiler-equivalence.test.ts \
src/__tests__/unit/harness-capability-contract.test.ts \
src/__tests__/unit/codex-widget-format-contract.test.ts \
src/__tests__/unit/codex-builtin-bridge.test.ts
→ 74/74 pass
npm run test → 2576/2576 pass
Completion criteria check (per user spec)
[x] npm run test all green (2576/2576)
[x] Context Compiler unit tests all green
[x] equivalence / expected-diff harness all green
[x] harness-capability-contract / codex-widget-format /
codex-builtin-bridge tests all green
[x] no new runtime-local prompt duplicates (Native re-exports
canonical; ClaudeCode imports canonical; bridge holds none)
[x] Codex bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four removed,
drift test pins their absence)
[x] all three Runtimes adapt compiler output, none redefine
capability prompts
Docs
- phase-5d-phase-2-context-compiler.md: slice statuses 2a–2e all
✅ 2026-05-17; note the one-shot delivery mode change.
- phase-5d-harness-capability-contract.md: Phase 2 row ✅, awaiting
Codex review.
- handover/harness-capability-contract.md: new "Context Compiler"
section detailing inputs/outputs/constraints, three-runtime
consumption pattern, Expected Differences Ledger contract.
- refactor-closeout.md: new decision-log entry recording the
Phase 2 delivery shape + completion criteria check.
Phase 5d Phase 2 ✅ pending Codex review. Phase 3 (Runtime
Capability Adapter) / Phase 4 (Artifact Contract) / Phase 5
(new-Runtime Playbook) intentionally NOT opened — stopping per
user instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t1tuesr@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

feat: add proxy configuration support for all network access - #9

Closed
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd
Closed

feat: add proxy configuration support for all network access#9
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd

Conversation

@t1tuesr

Copy link
Copy Markdown

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) are injected into the Claude Code subprocess, and Electron's session proxy is also set for renderer network requests.

https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings
page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY,
NO_PROXY) are injected into the Claude Code subprocess, and Electron's
session proxy is also set for renderer network requests.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
A minimal HTTP CONNECT proxy that logs all requests passing through it,
making it easy to confirm Claude API traffic is routed via the proxy.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
@t1tuesrt1tuesr closed this Feb 7, 2026
@t1tuesr
t1tuesr deleted the claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd branch February 7, 2026 15:39
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt #9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt #8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt #9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 op7418#2 补充连续水位推进机制
- 新增决策 op7418#9(图片接收)和 op7418#10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt op7418#9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt op7418#8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt op7418#9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
User mode change: "internal slice order preserved, external single
delivery; stop only after Phase 2 is done; Codex review takes the
batch." This commit lands slices 2a–2e together with all post-
review hardenings (Widget wire-format single source, Expected
Differences Ledger, runtimeHints prose ban).
Internal slice walk
2a — context-compiler.ts (NEW)
Pure function `compileContext(input): CompiledContext`. No IO,
no provider calls. Resolves enabledCapabilities (null = catalog
live default), looks up exposure for the calling runtime, emits
capabilityFragments + artifactContracts + memory + workspace +
toolDescriptors + runtimeHints + budget + systemPromptText +
diagnostics. Hard contracts: artifactContract before capability
in the assembled prompt; fragmentId uniqueness; cross-runtime
fragment text identity; compile-time FAIL if a capability
fragment text contains an artifact contract canonicalJson
(wire-format dedup); compile-time FAIL if load-bearing fragments
exceed budget. runtimeHints types strictly ID/refs/adapter
options — no prose, no template literals.
2b — expected-differences.ts (NEW)
Drift ledger. Initial 4 entries from slice 7b tech-debt. Three
slice_2d entries consumed by this commit (see 2d below); the
one remaining `follow_up` is image_generation MediaBlock shape
(non-prompt, future slice).
2c — ClaudeCode SDK (claude-client.ts) source-pin only
The SDK path has always imported MCP canonicals directly
(memory-search-mcp, notification-mcp, media-import-mcp,
cli-tools-mcp, dashboard-mcp) — no paraphrase ever existed.
Slice 2c codifies this with a contract test: claude-client.ts
must not import capability prompts from builtin-tools/* and
must not declare its own _SYSTEM_PROMPT scalars.
2d — Native Runtime (builtin-tools/*) re-export MCP canonicals
`memory-search.ts` now `export const MEMORY_SEARCH_SYSTEM_PROMPT =
CANONICAL_MEMORY_SEARCH_SYSTEM_PROMPT` (imported from
memory-search-mcp.ts). Same pattern for `notification.ts`
(NOTIFICATION_SYSTEM_PROMPT = NOTIFICATION_MCP_SYSTEM_PROMPT)
and `media.ts` (MEDIA_SYSTEM_PROMPT = MEDIA_MCP_SYSTEM_PROMPT
from media-import-mcp.ts). Three ledger entries removed in
sync.
2e — Codex bridge (builtin-bridge.ts + unified-adapter.ts)
Bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four declarations
deleted). `createCodePilotBuiltinTools().systemPrompt` is
permanently `''`. `unified-adapter.ts` now calls
`compileContext({ runtimeId: 'codex_runtime', ... })` and feeds
`compiled.systemPromptText` to Codex's `instructions`. A new
helper `capabilitiesFromBridgeToolNames` maps the bridge's
mounted tool names back to capability ids so the compiler's
enabledCapabilities aligns with what the bridge actually
exposes (workspace-gated memory tools naturally drop out when
workspacePath is empty).
Slice 2c Widget wire-format single source (review revision op7418#1)
WIDGET_SYSTEM_PROMPT in widget-guidelines.ts no longer
template-literal-embeds `${WIDGET_WIRE_FORMAT_SPEC}`. The
artifactContract is now the sole holder of the wire-format spec
+ canonical JSON. Compiler's `detectWireFormatDuplication` sanity
check throws at compile time if any capability fragment text
contains the artifact contract canonicalJson — that's the forcing
function preventing the spec from being re-injected.
Three regression pins enforce single occurrence in the compiled
prompt: CANONICAL_SHOW_WIDGET_JSON × 1, "FINAL OUTPUT FORMAT —
non-negotiable" × 1, WIDGET_WIRE_FORMAT_SPEC × 1.
runtimeHints boundary (review revision op7418#3)
ClaudeCodeHints / NativeHints / CodexProxyHints types now carry
only IDs (mcp server names, tool keys, builtin tool name set) +
adapter options (stopWhen, stepCount, passthroughToolTypes).
Tests pin: type-level (no string field > 64 chars, no newline,
no Markdown markers), runtime-level (scan all string values for
prose), source-grep (CodexProxyHints type definition can't
contain `promptOverride` / `promptExtra` / `widgetPrompt` / etc).
Tests
New harness-context-compiler.test.ts (23 pins): catalog hygiene,
Widget wire-format single source (op7418#10), ordering, budget
enforcement, cross-runtime fragment identity (op7418#9), tool
descriptors, runtimeHints boundary (op7418#11), Expected Differences
Ledger consistency (op7418#12), JSON parseability of every artifact
contract.
New harness-context-compiler-equivalence.test.ts (9 pins):
compiler source reachability, runtime drift honesty,
ledger/slice ownership correctness, "post-slice-2d: Native
ledger holds only the follow_up MediaBlock entry".
Updated harness-capability-contract.test.ts: drift pins now
check (a) bridge holds no local _PROMPT scalars, (b) Native
builtin-tools re-export MCP canonicals, (c) unified-adapter
imports compileContext + consumes systemPromptText, (d)
claude-client.ts doesn't import from builtin-tools/* and
doesn't declare own _SYSTEM_PROMPT.
Updated codex-widget-format-contract.test.ts: the "WIDGET_SYSTEM_PROMPT
embeds WIDGET_WIRE_FORMAT_SPEC" and "appears inside
WIDGET_SYSTEM_PROMPT" pins are flipped — slice 2c REMOVED the
embed; the new pins verify the compiler-side import line.
Updated codex-builtin-bridge.test.ts: tests previously asserting
`bridge.systemPrompt` contained capability tags now assert it
equals `''` (bridge is no longer the prompt-assembly point).
Verification
CODEX_DISABLED=1 npx tsx --test \
src/__tests__/unit/harness-context-compiler.test.ts \
src/__tests__/unit/harness-context-compiler-equivalence.test.ts \
src/__tests__/unit/harness-capability-contract.test.ts \
src/__tests__/unit/codex-widget-format-contract.test.ts \
src/__tests__/unit/codex-builtin-bridge.test.ts
→ 74/74 pass
npm run test → 2576/2576 pass
Completion criteria check (per user spec)
[x] npm run test all green (2576/2576)
[x] Context Compiler unit tests all green
[x] equivalence / expected-diff harness all green
[x] harness-capability-contract / codex-widget-format /
codex-builtin-bridge tests all green
[x] no new runtime-local prompt duplicates (Native re-exports
canonical; ClaudeCode imports canonical; bridge holds none)
[x] Codex bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four removed,
drift test pins their absence)
[x] all three Runtimes adapt compiler output, none redefine
capability prompts
Docs
- phase-5d-phase-2-context-compiler.md: slice statuses 2a–2e all
✅ 2026-05-17; note the one-shot delivery mode change.
- phase-5d-harness-capability-contract.md: Phase 2 row ✅, awaiting
Codex review.
- handover/harness-capability-contract.md: new "Context Compiler"
section detailing inputs/outputs/constraints, three-runtime
consumption pattern, Expected Differences Ledger contract.
- refactor-closeout.md: new decision-log entry recording the
Phase 2 delivery shape + completion criteria check.
Phase 5d Phase 2 ✅ pending Codex review. Phase 3 (Runtime
Capability Adapter) / Phase 4 (Artifact Contract) / Phase 5
(new-Runtime Playbook) intentionally NOT opened — stopping per
user instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t1tuesr@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat: add proxy configuration support for all network access - #9

Closed
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd
Closed

feat: add proxy configuration support for all network access#9
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd

Conversation

@t1tuesr

Copy link
Copy Markdown

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) are injected into the Claude Code subprocess, and Electron's session proxy is also set for renderer network requests.

https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings
page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY,
NO_PROXY) are injected into the Claude Code subprocess, and Electron's
session proxy is also set for renderer network requests.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
A minimal HTTP CONNECT proxy that logs all requests passing through it,
making it easy to confirm Claude API traffic is routed via the proxy.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
@t1tuesrt1tuesr closed this Feb 7, 2026
@t1tuesr
t1tuesr deleted the claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd branch February 7, 2026 15:39
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt #9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt #8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt #9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 op7418#2 补充连续水位推进机制
- 新增决策 op7418#9(图片接收)和 op7418#10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt op7418#9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt op7418#8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt op7418#9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
User mode change: "internal slice order preserved, external single
delivery; stop only after Phase 2 is done; Codex review takes the
batch." This commit lands slices 2a–2e together with all post-
review hardenings (Widget wire-format single source, Expected
Differences Ledger, runtimeHints prose ban).
Internal slice walk
2a — context-compiler.ts (NEW)
Pure function `compileContext(input): CompiledContext`. No IO,
no provider calls. Resolves enabledCapabilities (null = catalog
live default), looks up exposure for the calling runtime, emits
capabilityFragments + artifactContracts + memory + workspace +
toolDescriptors + runtimeHints + budget + systemPromptText +
diagnostics. Hard contracts: artifactContract before capability
in the assembled prompt; fragmentId uniqueness; cross-runtime
fragment text identity; compile-time FAIL if a capability
fragment text contains an artifact contract canonicalJson
(wire-format dedup); compile-time FAIL if load-bearing fragments
exceed budget. runtimeHints types strictly ID/refs/adapter
options — no prose, no template literals.
2b — expected-differences.ts (NEW)
Drift ledger. Initial 4 entries from slice 7b tech-debt. Three
slice_2d entries consumed by this commit (see 2d below); the
one remaining `follow_up` is image_generation MediaBlock shape
(non-prompt, future slice).
2c — ClaudeCode SDK (claude-client.ts) source-pin only
The SDK path has always imported MCP canonicals directly
(memory-search-mcp, notification-mcp, media-import-mcp,
cli-tools-mcp, dashboard-mcp) — no paraphrase ever existed.
Slice 2c codifies this with a contract test: claude-client.ts
must not import capability prompts from builtin-tools/* and
must not declare its own _SYSTEM_PROMPT scalars.
2d — Native Runtime (builtin-tools/*) re-export MCP canonicals
`memory-search.ts` now `export const MEMORY_SEARCH_SYSTEM_PROMPT =
CANONICAL_MEMORY_SEARCH_SYSTEM_PROMPT` (imported from
memory-search-mcp.ts). Same pattern for `notification.ts`
(NOTIFICATION_SYSTEM_PROMPT = NOTIFICATION_MCP_SYSTEM_PROMPT)
and `media.ts` (MEDIA_SYSTEM_PROMPT = MEDIA_MCP_SYSTEM_PROMPT
from media-import-mcp.ts). Three ledger entries removed in
sync.
2e — Codex bridge (builtin-bridge.ts + unified-adapter.ts)
Bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four declarations
deleted). `createCodePilotBuiltinTools().systemPrompt` is
permanently `''`. `unified-adapter.ts` now calls
`compileContext({ runtimeId: 'codex_runtime', ... })` and feeds
`compiled.systemPromptText` to Codex's `instructions`. A new
helper `capabilitiesFromBridgeToolNames` maps the bridge's
mounted tool names back to capability ids so the compiler's
enabledCapabilities aligns with what the bridge actually
exposes (workspace-gated memory tools naturally drop out when
workspacePath is empty).
Slice 2c Widget wire-format single source (review revision op7418#1)
WIDGET_SYSTEM_PROMPT in widget-guidelines.ts no longer
template-literal-embeds `${WIDGET_WIRE_FORMAT_SPEC}`. The
artifactContract is now the sole holder of the wire-format spec
+ canonical JSON. Compiler's `detectWireFormatDuplication` sanity
check throws at compile time if any capability fragment text
contains the artifact contract canonicalJson — that's the forcing
function preventing the spec from being re-injected.
Three regression pins enforce single occurrence in the compiled
prompt: CANONICAL_SHOW_WIDGET_JSON × 1, "FINAL OUTPUT FORMAT —
non-negotiable" × 1, WIDGET_WIRE_FORMAT_SPEC × 1.
runtimeHints boundary (review revision op7418#3)
ClaudeCodeHints / NativeHints / CodexProxyHints types now carry
only IDs (mcp server names, tool keys, builtin tool name set) +
adapter options (stopWhen, stepCount, passthroughToolTypes).
Tests pin: type-level (no string field > 64 chars, no newline,
no Markdown markers), runtime-level (scan all string values for
prose), source-grep (CodexProxyHints type definition can't
contain `promptOverride` / `promptExtra` / `widgetPrompt` / etc).
Tests
New harness-context-compiler.test.ts (23 pins): catalog hygiene,
Widget wire-format single source (op7418#10), ordering, budget
enforcement, cross-runtime fragment identity (op7418#9), tool
descriptors, runtimeHints boundary (op7418#11), Expected Differences
Ledger consistency (op7418#12), JSON parseability of every artifact
contract.
New harness-context-compiler-equivalence.test.ts (9 pins):
compiler source reachability, runtime drift honesty,
ledger/slice ownership correctness, "post-slice-2d: Native
ledger holds only the follow_up MediaBlock entry".
Updated harness-capability-contract.test.ts: drift pins now
check (a) bridge holds no local _PROMPT scalars, (b) Native
builtin-tools re-export MCP canonicals, (c) unified-adapter
imports compileContext + consumes systemPromptText, (d)
claude-client.ts doesn't import from builtin-tools/* and
doesn't declare own _SYSTEM_PROMPT.
Updated codex-widget-format-contract.test.ts: the "WIDGET_SYSTEM_PROMPT
embeds WIDGET_WIRE_FORMAT_SPEC" and "appears inside
WIDGET_SYSTEM_PROMPT" pins are flipped — slice 2c REMOVED the
embed; the new pins verify the compiler-side import line.
Updated codex-builtin-bridge.test.ts: tests previously asserting
`bridge.systemPrompt` contained capability tags now assert it
equals `''` (bridge is no longer the prompt-assembly point).
Verification
CODEX_DISABLED=1 npx tsx --test \
src/__tests__/unit/harness-context-compiler.test.ts \
src/__tests__/unit/harness-context-compiler-equivalence.test.ts \
src/__tests__/unit/harness-capability-contract.test.ts \
src/__tests__/unit/codex-widget-format-contract.test.ts \
src/__tests__/unit/codex-builtin-bridge.test.ts
→ 74/74 pass
npm run test → 2576/2576 pass
Completion criteria check (per user spec)
[x] npm run test all green (2576/2576)
[x] Context Compiler unit tests all green
[x] equivalence / expected-diff harness all green
[x] harness-capability-contract / codex-widget-format /
codex-builtin-bridge tests all green
[x] no new runtime-local prompt duplicates (Native re-exports
canonical; ClaudeCode imports canonical; bridge holds none)
[x] Codex bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four removed,
drift test pins their absence)
[x] all three Runtimes adapt compiler output, none redefine
capability prompts
Docs
- phase-5d-phase-2-context-compiler.md: slice statuses 2a–2e all
✅ 2026-05-17; note the one-shot delivery mode change.
- phase-5d-harness-capability-contract.md: Phase 2 row ✅, awaiting
Codex review.
- handover/harness-capability-contract.md: new "Context Compiler"
section detailing inputs/outputs/constraints, three-runtime
consumption pattern, Expected Differences Ledger contract.
- refactor-closeout.md: new decision-log entry recording the
Phase 2 delivery shape + completion criteria check.
Phase 5d Phase 2 ✅ pending Codex review. Phase 3 (Runtime
Capability Adapter) / Phase 4 (Artifact Contract) / Phase 5
(new-Runtime Playbook) intentionally NOT opened — stopping per
user instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t1tuesr@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat: add proxy configuration support for all network access - #9

Closed
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd
Closed

feat: add proxy configuration support for all network access#9
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd

Conversation

@t1tuesr

Copy link
Copy Markdown

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) are injected into the Claude Code subprocess, and Electron's session proxy is also set for renderer network requests.

https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings
page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY,
NO_PROXY) are injected into the Claude Code subprocess, and Electron's
session proxy is also set for renderer network requests.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
A minimal HTTP CONNECT proxy that logs all requests passing through it,
making it easy to confirm Claude API traffic is routed via the proxy.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
@t1tuesrt1tuesr closed this Feb 7, 2026
@t1tuesr
t1tuesr deleted the claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd branch February 7, 2026 15:39
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt #9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt #8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt #9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 op7418#2 补充连续水位推进机制
- 新增决策 op7418#9(图片接收)和 op7418#10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt op7418#9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt op7418#8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt op7418#9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
User mode change: "internal slice order preserved, external single
delivery; stop only after Phase 2 is done; Codex review takes the
batch." This commit lands slices 2a–2e together with all post-
review hardenings (Widget wire-format single source, Expected
Differences Ledger, runtimeHints prose ban).
Internal slice walk
2a — context-compiler.ts (NEW)
Pure function `compileContext(input): CompiledContext`. No IO,
no provider calls. Resolves enabledCapabilities (null = catalog
live default), looks up exposure for the calling runtime, emits
capabilityFragments + artifactContracts + memory + workspace +
toolDescriptors + runtimeHints + budget + systemPromptText +
diagnostics. Hard contracts: artifactContract before capability
in the assembled prompt; fragmentId uniqueness; cross-runtime
fragment text identity; compile-time FAIL if a capability
fragment text contains an artifact contract canonicalJson
(wire-format dedup); compile-time FAIL if load-bearing fragments
exceed budget. runtimeHints types strictly ID/refs/adapter
options — no prose, no template literals.
2b — expected-differences.ts (NEW)
Drift ledger. Initial 4 entries from slice 7b tech-debt. Three
slice_2d entries consumed by this commit (see 2d below); the
one remaining `follow_up` is image_generation MediaBlock shape
(non-prompt, future slice).
2c — ClaudeCode SDK (claude-client.ts) source-pin only
The SDK path has always imported MCP canonicals directly
(memory-search-mcp, notification-mcp, media-import-mcp,
cli-tools-mcp, dashboard-mcp) — no paraphrase ever existed.
Slice 2c codifies this with a contract test: claude-client.ts
must not import capability prompts from builtin-tools/* and
must not declare its own _SYSTEM_PROMPT scalars.
2d — Native Runtime (builtin-tools/*) re-export MCP canonicals
`memory-search.ts` now `export const MEMORY_SEARCH_SYSTEM_PROMPT =
CANONICAL_MEMORY_SEARCH_SYSTEM_PROMPT` (imported from
memory-search-mcp.ts). Same pattern for `notification.ts`
(NOTIFICATION_SYSTEM_PROMPT = NOTIFICATION_MCP_SYSTEM_PROMPT)
and `media.ts` (MEDIA_SYSTEM_PROMPT = MEDIA_MCP_SYSTEM_PROMPT
from media-import-mcp.ts). Three ledger entries removed in
sync.
2e — Codex bridge (builtin-bridge.ts + unified-adapter.ts)
Bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four declarations
deleted). `createCodePilotBuiltinTools().systemPrompt` is
permanently `''`. `unified-adapter.ts` now calls
`compileContext({ runtimeId: 'codex_runtime', ... })` and feeds
`compiled.systemPromptText` to Codex's `instructions`. A new
helper `capabilitiesFromBridgeToolNames` maps the bridge's
mounted tool names back to capability ids so the compiler's
enabledCapabilities aligns with what the bridge actually
exposes (workspace-gated memory tools naturally drop out when
workspacePath is empty).
Slice 2c Widget wire-format single source (review revision op7418#1)
WIDGET_SYSTEM_PROMPT in widget-guidelines.ts no longer
template-literal-embeds `${WIDGET_WIRE_FORMAT_SPEC}`. The
artifactContract is now the sole holder of the wire-format spec
+ canonical JSON. Compiler's `detectWireFormatDuplication` sanity
check throws at compile time if any capability fragment text
contains the artifact contract canonicalJson — that's the forcing
function preventing the spec from being re-injected.
Three regression pins enforce single occurrence in the compiled
prompt: CANONICAL_SHOW_WIDGET_JSON × 1, "FINAL OUTPUT FORMAT —
non-negotiable" × 1, WIDGET_WIRE_FORMAT_SPEC × 1.
runtimeHints boundary (review revision op7418#3)
ClaudeCodeHints / NativeHints / CodexProxyHints types now carry
only IDs (mcp server names, tool keys, builtin tool name set) +
adapter options (stopWhen, stepCount, passthroughToolTypes).
Tests pin: type-level (no string field > 64 chars, no newline,
no Markdown markers), runtime-level (scan all string values for
prose), source-grep (CodexProxyHints type definition can't
contain `promptOverride` / `promptExtra` / `widgetPrompt` / etc).
Tests
New harness-context-compiler.test.ts (23 pins): catalog hygiene,
Widget wire-format single source (op7418#10), ordering, budget
enforcement, cross-runtime fragment identity (op7418#9), tool
descriptors, runtimeHints boundary (op7418#11), Expected Differences
Ledger consistency (op7418#12), JSON parseability of every artifact
contract.
New harness-context-compiler-equivalence.test.ts (9 pins):
compiler source reachability, runtime drift honesty,
ledger/slice ownership correctness, "post-slice-2d: Native
ledger holds only the follow_up MediaBlock entry".
Updated harness-capability-contract.test.ts: drift pins now
check (a) bridge holds no local _PROMPT scalars, (b) Native
builtin-tools re-export MCP canonicals, (c) unified-adapter
imports compileContext + consumes systemPromptText, (d)
claude-client.ts doesn't import from builtin-tools/* and
doesn't declare own _SYSTEM_PROMPT.
Updated codex-widget-format-contract.test.ts: the "WIDGET_SYSTEM_PROMPT
embeds WIDGET_WIRE_FORMAT_SPEC" and "appears inside
WIDGET_SYSTEM_PROMPT" pins are flipped — slice 2c REMOVED the
embed; the new pins verify the compiler-side import line.
Updated codex-builtin-bridge.test.ts: tests previously asserting
`bridge.systemPrompt` contained capability tags now assert it
equals `''` (bridge is no longer the prompt-assembly point).
Verification
CODEX_DISABLED=1 npx tsx --test \
src/__tests__/unit/harness-context-compiler.test.ts \
src/__tests__/unit/harness-context-compiler-equivalence.test.ts \
src/__tests__/unit/harness-capability-contract.test.ts \
src/__tests__/unit/codex-widget-format-contract.test.ts \
src/__tests__/unit/codex-builtin-bridge.test.ts
→ 74/74 pass
npm run test → 2576/2576 pass
Completion criteria check (per user spec)
[x] npm run test all green (2576/2576)
[x] Context Compiler unit tests all green
[x] equivalence / expected-diff harness all green
[x] harness-capability-contract / codex-widget-format /
codex-builtin-bridge tests all green
[x] no new runtime-local prompt duplicates (Native re-exports
canonical; ClaudeCode imports canonical; bridge holds none)
[x] Codex bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four removed,
drift test pins their absence)
[x] all three Runtimes adapt compiler output, none redefine
capability prompts
Docs
- phase-5d-phase-2-context-compiler.md: slice statuses 2a–2e all
✅ 2026-05-17; note the one-shot delivery mode change.
- phase-5d-harness-capability-contract.md: Phase 2 row ✅, awaiting
Codex review.
- handover/harness-capability-contract.md: new "Context Compiler"
section detailing inputs/outputs/constraints, three-runtime
consumption pattern, Expected Differences Ledger contract.
- refactor-closeout.md: new decision-log entry recording the
Phase 2 delivery shape + completion criteria check.
Phase 5d Phase 2 ✅ pending Codex review. Phase 3 (Runtime
Capability Adapter) / Phase 4 (Artifact Contract) / Phase 5
(new-Runtime Playbook) intentionally NOT opened — stopping per
user instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t1tuesr@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

feat: add proxy configuration support for all network access - #9

Closed
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd
Closed

feat: add proxy configuration support for all network access#9
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd

Conversation

@t1tuesr

Copy link
Copy Markdown

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) are injected into the Claude Code subprocess, and Electron's session proxy is also set for renderer network requests.

https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings
page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY,
NO_PROXY) are injected into the Claude Code subprocess, and Electron's
session proxy is also set for renderer network requests.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
A minimal HTTP CONNECT proxy that logs all requests passing through it,
making it easy to confirm Claude API traffic is routed via the proxy.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
@t1tuesrt1tuesr closed this Feb 7, 2026
@t1tuesr
t1tuesr deleted the claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd branch February 7, 2026 15:39
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt #9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt #8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt #9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 op7418#2 补充连续水位推进机制
- 新增决策 op7418#9(图片接收)和 op7418#10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt op7418#9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt op7418#8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt op7418#9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
User mode change: "internal slice order preserved, external single
delivery; stop only after Phase 2 is done; Codex review takes the
batch." This commit lands slices 2a–2e together with all post-
review hardenings (Widget wire-format single source, Expected
Differences Ledger, runtimeHints prose ban).
Internal slice walk
2a — context-compiler.ts (NEW)
Pure function `compileContext(input): CompiledContext`. No IO,
no provider calls. Resolves enabledCapabilities (null = catalog
live default), looks up exposure for the calling runtime, emits
capabilityFragments + artifactContracts + memory + workspace +
toolDescriptors + runtimeHints + budget + systemPromptText +
diagnostics. Hard contracts: artifactContract before capability
in the assembled prompt; fragmentId uniqueness; cross-runtime
fragment text identity; compile-time FAIL if a capability
fragment text contains an artifact contract canonicalJson
(wire-format dedup); compile-time FAIL if load-bearing fragments
exceed budget. runtimeHints types strictly ID/refs/adapter
options — no prose, no template literals.
2b — expected-differences.ts (NEW)
Drift ledger. Initial 4 entries from slice 7b tech-debt. Three
slice_2d entries consumed by this commit (see 2d below); the
one remaining `follow_up` is image_generation MediaBlock shape
(non-prompt, future slice).
2c — ClaudeCode SDK (claude-client.ts) source-pin only
The SDK path has always imported MCP canonicals directly
(memory-search-mcp, notification-mcp, media-import-mcp,
cli-tools-mcp, dashboard-mcp) — no paraphrase ever existed.
Slice 2c codifies this with a contract test: claude-client.ts
must not import capability prompts from builtin-tools/* and
must not declare its own _SYSTEM_PROMPT scalars.
2d — Native Runtime (builtin-tools/*) re-export MCP canonicals
`memory-search.ts` now `export const MEMORY_SEARCH_SYSTEM_PROMPT =
CANONICAL_MEMORY_SEARCH_SYSTEM_PROMPT` (imported from
memory-search-mcp.ts). Same pattern for `notification.ts`
(NOTIFICATION_SYSTEM_PROMPT = NOTIFICATION_MCP_SYSTEM_PROMPT)
and `media.ts` (MEDIA_SYSTEM_PROMPT = MEDIA_MCP_SYSTEM_PROMPT
from media-import-mcp.ts). Three ledger entries removed in
sync.
2e — Codex bridge (builtin-bridge.ts + unified-adapter.ts)
Bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four declarations
deleted). `createCodePilotBuiltinTools().systemPrompt` is
permanently `''`. `unified-adapter.ts` now calls
`compileContext({ runtimeId: 'codex_runtime', ... })` and feeds
`compiled.systemPromptText` to Codex's `instructions`. A new
helper `capabilitiesFromBridgeToolNames` maps the bridge's
mounted tool names back to capability ids so the compiler's
enabledCapabilities aligns with what the bridge actually
exposes (workspace-gated memory tools naturally drop out when
workspacePath is empty).
Slice 2c Widget wire-format single source (review revision op7418#1)
WIDGET_SYSTEM_PROMPT in widget-guidelines.ts no longer
template-literal-embeds `${WIDGET_WIRE_FORMAT_SPEC}`. The
artifactContract is now the sole holder of the wire-format spec
+ canonical JSON. Compiler's `detectWireFormatDuplication` sanity
check throws at compile time if any capability fragment text
contains the artifact contract canonicalJson — that's the forcing
function preventing the spec from being re-injected.
Three regression pins enforce single occurrence in the compiled
prompt: CANONICAL_SHOW_WIDGET_JSON × 1, "FINAL OUTPUT FORMAT —
non-negotiable" × 1, WIDGET_WIRE_FORMAT_SPEC × 1.
runtimeHints boundary (review revision op7418#3)
ClaudeCodeHints / NativeHints / CodexProxyHints types now carry
only IDs (mcp server names, tool keys, builtin tool name set) +
adapter options (stopWhen, stepCount, passthroughToolTypes).
Tests pin: type-level (no string field > 64 chars, no newline,
no Markdown markers), runtime-level (scan all string values for
prose), source-grep (CodexProxyHints type definition can't
contain `promptOverride` / `promptExtra` / `widgetPrompt` / etc).
Tests
New harness-context-compiler.test.ts (23 pins): catalog hygiene,
Widget wire-format single source (op7418#10), ordering, budget
enforcement, cross-runtime fragment identity (op7418#9), tool
descriptors, runtimeHints boundary (op7418#11), Expected Differences
Ledger consistency (op7418#12), JSON parseability of every artifact
contract.
New harness-context-compiler-equivalence.test.ts (9 pins):
compiler source reachability, runtime drift honesty,
ledger/slice ownership correctness, "post-slice-2d: Native
ledger holds only the follow_up MediaBlock entry".
Updated harness-capability-contract.test.ts: drift pins now
check (a) bridge holds no local _PROMPT scalars, (b) Native
builtin-tools re-export MCP canonicals, (c) unified-adapter
imports compileContext + consumes systemPromptText, (d)
claude-client.ts doesn't import from builtin-tools/* and
doesn't declare own _SYSTEM_PROMPT.
Updated codex-widget-format-contract.test.ts: the "WIDGET_SYSTEM_PROMPT
embeds WIDGET_WIRE_FORMAT_SPEC" and "appears inside
WIDGET_SYSTEM_PROMPT" pins are flipped — slice 2c REMOVED the
embed; the new pins verify the compiler-side import line.
Updated codex-builtin-bridge.test.ts: tests previously asserting
`bridge.systemPrompt` contained capability tags now assert it
equals `''` (bridge is no longer the prompt-assembly point).
Verification
CODEX_DISABLED=1 npx tsx --test \
src/__tests__/unit/harness-context-compiler.test.ts \
src/__tests__/unit/harness-context-compiler-equivalence.test.ts \
src/__tests__/unit/harness-capability-contract.test.ts \
src/__tests__/unit/codex-widget-format-contract.test.ts \
src/__tests__/unit/codex-builtin-bridge.test.ts
→ 74/74 pass
npm run test → 2576/2576 pass
Completion criteria check (per user spec)
[x] npm run test all green (2576/2576)
[x] Context Compiler unit tests all green
[x] equivalence / expected-diff harness all green
[x] harness-capability-contract / codex-widget-format /
codex-builtin-bridge tests all green
[x] no new runtime-local prompt duplicates (Native re-exports
canonical; ClaudeCode imports canonical; bridge holds none)
[x] Codex bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four removed,
drift test pins their absence)
[x] all three Runtimes adapt compiler output, none redefine
capability prompts
Docs
- phase-5d-phase-2-context-compiler.md: slice statuses 2a–2e all
✅ 2026-05-17; note the one-shot delivery mode change.
- phase-5d-harness-capability-contract.md: Phase 2 row ✅, awaiting
Codex review.
- handover/harness-capability-contract.md: new "Context Compiler"
section detailing inputs/outputs/constraints, three-runtime
consumption pattern, Expected Differences Ledger contract.
- refactor-closeout.md: new decision-log entry recording the
Phase 2 delivery shape + completion criteria check.
Phase 5d Phase 2 ✅ pending Codex review. Phase 3 (Runtime
Capability Adapter) / Phase 4 (Artifact Contract) / Phase 5
(new-Runtime Playbook) intentionally NOT opened — stopping per
user instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t1tuesr@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat: add proxy configuration support for all network access - #9

Closed
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd
Closed

feat: add proxy configuration support for all network access#9
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd

Conversation

@t1tuesr

Copy link
Copy Markdown

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) are injected into the Claude Code subprocess, and Electron's session proxy is also set for renderer network requests.

https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings
page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY,
NO_PROXY) are injected into the Claude Code subprocess, and Electron's
session proxy is also set for renderer network requests.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
A minimal HTTP CONNECT proxy that logs all requests passing through it,
making it easy to confirm Claude API traffic is routed via the proxy.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
@t1tuesrt1tuesr closed this Feb 7, 2026
@t1tuesr
t1tuesr deleted the claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd branch February 7, 2026 15:39
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt #9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt #8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt #9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 op7418#2 补充连续水位推进机制
- 新增决策 op7418#9(图片接收)和 op7418#10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt op7418#9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt op7418#8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt op7418#9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
User mode change: "internal slice order preserved, external single
delivery; stop only after Phase 2 is done; Codex review takes the
batch." This commit lands slices 2a–2e together with all post-
review hardenings (Widget wire-format single source, Expected
Differences Ledger, runtimeHints prose ban).
Internal slice walk
2a — context-compiler.ts (NEW)
Pure function `compileContext(input): CompiledContext`. No IO,
no provider calls. Resolves enabledCapabilities (null = catalog
live default), looks up exposure for the calling runtime, emits
capabilityFragments + artifactContracts + memory + workspace +
toolDescriptors + runtimeHints + budget + systemPromptText +
diagnostics. Hard contracts: artifactContract before capability
in the assembled prompt; fragmentId uniqueness; cross-runtime
fragment text identity; compile-time FAIL if a capability
fragment text contains an artifact contract canonicalJson
(wire-format dedup); compile-time FAIL if load-bearing fragments
exceed budget. runtimeHints types strictly ID/refs/adapter
options — no prose, no template literals.
2b — expected-differences.ts (NEW)
Drift ledger. Initial 4 entries from slice 7b tech-debt. Three
slice_2d entries consumed by this commit (see 2d below); the
one remaining `follow_up` is image_generation MediaBlock shape
(non-prompt, future slice).
2c — ClaudeCode SDK (claude-client.ts) source-pin only
The SDK path has always imported MCP canonicals directly
(memory-search-mcp, notification-mcp, media-import-mcp,
cli-tools-mcp, dashboard-mcp) — no paraphrase ever existed.
Slice 2c codifies this with a contract test: claude-client.ts
must not import capability prompts from builtin-tools/* and
must not declare its own _SYSTEM_PROMPT scalars.
2d — Native Runtime (builtin-tools/*) re-export MCP canonicals
`memory-search.ts` now `export const MEMORY_SEARCH_SYSTEM_PROMPT =
CANONICAL_MEMORY_SEARCH_SYSTEM_PROMPT` (imported from
memory-search-mcp.ts). Same pattern for `notification.ts`
(NOTIFICATION_SYSTEM_PROMPT = NOTIFICATION_MCP_SYSTEM_PROMPT)
and `media.ts` (MEDIA_SYSTEM_PROMPT = MEDIA_MCP_SYSTEM_PROMPT
from media-import-mcp.ts). Three ledger entries removed in
sync.
2e — Codex bridge (builtin-bridge.ts + unified-adapter.ts)
Bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four declarations
deleted). `createCodePilotBuiltinTools().systemPrompt` is
permanently `''`. `unified-adapter.ts` now calls
`compileContext({ runtimeId: 'codex_runtime', ... })` and feeds
`compiled.systemPromptText` to Codex's `instructions`. A new
helper `capabilitiesFromBridgeToolNames` maps the bridge's
mounted tool names back to capability ids so the compiler's
enabledCapabilities aligns with what the bridge actually
exposes (workspace-gated memory tools naturally drop out when
workspacePath is empty).
Slice 2c Widget wire-format single source (review revision op7418#1)
WIDGET_SYSTEM_PROMPT in widget-guidelines.ts no longer
template-literal-embeds `${WIDGET_WIRE_FORMAT_SPEC}`. The
artifactContract is now the sole holder of the wire-format spec
+ canonical JSON. Compiler's `detectWireFormatDuplication` sanity
check throws at compile time if any capability fragment text
contains the artifact contract canonicalJson — that's the forcing
function preventing the spec from being re-injected.
Three regression pins enforce single occurrence in the compiled
prompt: CANONICAL_SHOW_WIDGET_JSON × 1, "FINAL OUTPUT FORMAT —
non-negotiable" × 1, WIDGET_WIRE_FORMAT_SPEC × 1.
runtimeHints boundary (review revision op7418#3)
ClaudeCodeHints / NativeHints / CodexProxyHints types now carry
only IDs (mcp server names, tool keys, builtin tool name set) +
adapter options (stopWhen, stepCount, passthroughToolTypes).
Tests pin: type-level (no string field > 64 chars, no newline,
no Markdown markers), runtime-level (scan all string values for
prose), source-grep (CodexProxyHints type definition can't
contain `promptOverride` / `promptExtra` / `widgetPrompt` / etc).
Tests
New harness-context-compiler.test.ts (23 pins): catalog hygiene,
Widget wire-format single source (op7418#10), ordering, budget
enforcement, cross-runtime fragment identity (op7418#9), tool
descriptors, runtimeHints boundary (op7418#11), Expected Differences
Ledger consistency (op7418#12), JSON parseability of every artifact
contract.
New harness-context-compiler-equivalence.test.ts (9 pins):
compiler source reachability, runtime drift honesty,
ledger/slice ownership correctness, "post-slice-2d: Native
ledger holds only the follow_up MediaBlock entry".
Updated harness-capability-contract.test.ts: drift pins now
check (a) bridge holds no local _PROMPT scalars, (b) Native
builtin-tools re-export MCP canonicals, (c) unified-adapter
imports compileContext + consumes systemPromptText, (d)
claude-client.ts doesn't import from builtin-tools/* and
doesn't declare own _SYSTEM_PROMPT.
Updated codex-widget-format-contract.test.ts: the "WIDGET_SYSTEM_PROMPT
embeds WIDGET_WIRE_FORMAT_SPEC" and "appears inside
WIDGET_SYSTEM_PROMPT" pins are flipped — slice 2c REMOVED the
embed; the new pins verify the compiler-side import line.
Updated codex-builtin-bridge.test.ts: tests previously asserting
`bridge.systemPrompt` contained capability tags now assert it
equals `''` (bridge is no longer the prompt-assembly point).
Verification
CODEX_DISABLED=1 npx tsx --test \
src/__tests__/unit/harness-context-compiler.test.ts \
src/__tests__/unit/harness-context-compiler-equivalence.test.ts \
src/__tests__/unit/harness-capability-contract.test.ts \
src/__tests__/unit/codex-widget-format-contract.test.ts \
src/__tests__/unit/codex-builtin-bridge.test.ts
→ 74/74 pass
npm run test → 2576/2576 pass
Completion criteria check (per user spec)
[x] npm run test all green (2576/2576)
[x] Context Compiler unit tests all green
[x] equivalence / expected-diff harness all green
[x] harness-capability-contract / codex-widget-format /
codex-builtin-bridge tests all green
[x] no new runtime-local prompt duplicates (Native re-exports
canonical; ClaudeCode imports canonical; bridge holds none)
[x] Codex bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four removed,
drift test pins their absence)
[x] all three Runtimes adapt compiler output, none redefine
capability prompts
Docs
- phase-5d-phase-2-context-compiler.md: slice statuses 2a–2e all
✅ 2026-05-17; note the one-shot delivery mode change.
- phase-5d-harness-capability-contract.md: Phase 2 row ✅, awaiting
Codex review.
- handover/harness-capability-contract.md: new "Context Compiler"
section detailing inputs/outputs/constraints, three-runtime
consumption pattern, Expected Differences Ledger contract.
- refactor-closeout.md: new decision-log entry recording the
Phase 2 delivery shape + completion criteria check.
Phase 5d Phase 2 ✅ pending Codex review. Phase 3 (Runtime
Capability Adapter) / Phase 4 (Artifact Contract) / Phase 5
(new-Runtime Playbook) intentionally NOT opened — stopping per
user instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t1tuesr@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat: add proxy configuration support for all network access - #9

Closed
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd
Closed

feat: add proxy configuration support for all network access#9
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd

Conversation

@t1tuesr

Copy link
Copy Markdown

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) are injected into the Claude Code subprocess, and Electron's session proxy is also set for renderer network requests.

https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings
page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY,
NO_PROXY) are injected into the Claude Code subprocess, and Electron's
session proxy is also set for renderer network requests.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
A minimal HTTP CONNECT proxy that logs all requests passing through it,
making it easy to confirm Claude API traffic is routed via the proxy.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
@t1tuesrt1tuesr closed this Feb 7, 2026
@t1tuesr
t1tuesr deleted the claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd branch February 7, 2026 15:39
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt #9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt #8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt #9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 op7418#2 补充连续水位推进机制
- 新增决策 op7418#9(图片接收)和 op7418#10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt op7418#9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt op7418#8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt op7418#9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
User mode change: "internal slice order preserved, external single
delivery; stop only after Phase 2 is done; Codex review takes the
batch." This commit lands slices 2a–2e together with all post-
review hardenings (Widget wire-format single source, Expected
Differences Ledger, runtimeHints prose ban).
Internal slice walk
2a — context-compiler.ts (NEW)
Pure function `compileContext(input): CompiledContext`. No IO,
no provider calls. Resolves enabledCapabilities (null = catalog
live default), looks up exposure for the calling runtime, emits
capabilityFragments + artifactContracts + memory + workspace +
toolDescriptors + runtimeHints + budget + systemPromptText +
diagnostics. Hard contracts: artifactContract before capability
in the assembled prompt; fragmentId uniqueness; cross-runtime
fragment text identity; compile-time FAIL if a capability
fragment text contains an artifact contract canonicalJson
(wire-format dedup); compile-time FAIL if load-bearing fragments
exceed budget. runtimeHints types strictly ID/refs/adapter
options — no prose, no template literals.
2b — expected-differences.ts (NEW)
Drift ledger. Initial 4 entries from slice 7b tech-debt. Three
slice_2d entries consumed by this commit (see 2d below); the
one remaining `follow_up` is image_generation MediaBlock shape
(non-prompt, future slice).
2c — ClaudeCode SDK (claude-client.ts) source-pin only
The SDK path has always imported MCP canonicals directly
(memory-search-mcp, notification-mcp, media-import-mcp,
cli-tools-mcp, dashboard-mcp) — no paraphrase ever existed.
Slice 2c codifies this with a contract test: claude-client.ts
must not import capability prompts from builtin-tools/* and
must not declare its own _SYSTEM_PROMPT scalars.
2d — Native Runtime (builtin-tools/*) re-export MCP canonicals
`memory-search.ts` now `export const MEMORY_SEARCH_SYSTEM_PROMPT =
CANONICAL_MEMORY_SEARCH_SYSTEM_PROMPT` (imported from
memory-search-mcp.ts). Same pattern for `notification.ts`
(NOTIFICATION_SYSTEM_PROMPT = NOTIFICATION_MCP_SYSTEM_PROMPT)
and `media.ts` (MEDIA_SYSTEM_PROMPT = MEDIA_MCP_SYSTEM_PROMPT
from media-import-mcp.ts). Three ledger entries removed in
sync.
2e — Codex bridge (builtin-bridge.ts + unified-adapter.ts)
Bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four declarations
deleted). `createCodePilotBuiltinTools().systemPrompt` is
permanently `''`. `unified-adapter.ts` now calls
`compileContext({ runtimeId: 'codex_runtime', ... })` and feeds
`compiled.systemPromptText` to Codex's `instructions`. A new
helper `capabilitiesFromBridgeToolNames` maps the bridge's
mounted tool names back to capability ids so the compiler's
enabledCapabilities aligns with what the bridge actually
exposes (workspace-gated memory tools naturally drop out when
workspacePath is empty).
Slice 2c Widget wire-format single source (review revision op7418#1)
WIDGET_SYSTEM_PROMPT in widget-guidelines.ts no longer
template-literal-embeds `${WIDGET_WIRE_FORMAT_SPEC}`. The
artifactContract is now the sole holder of the wire-format spec
+ canonical JSON. Compiler's `detectWireFormatDuplication` sanity
check throws at compile time if any capability fragment text
contains the artifact contract canonicalJson — that's the forcing
function preventing the spec from being re-injected.
Three regression pins enforce single occurrence in the compiled
prompt: CANONICAL_SHOW_WIDGET_JSON × 1, "FINAL OUTPUT FORMAT —
non-negotiable" × 1, WIDGET_WIRE_FORMAT_SPEC × 1.
runtimeHints boundary (review revision op7418#3)
ClaudeCodeHints / NativeHints / CodexProxyHints types now carry
only IDs (mcp server names, tool keys, builtin tool name set) +
adapter options (stopWhen, stepCount, passthroughToolTypes).
Tests pin: type-level (no string field > 64 chars, no newline,
no Markdown markers), runtime-level (scan all string values for
prose), source-grep (CodexProxyHints type definition can't
contain `promptOverride` / `promptExtra` / `widgetPrompt` / etc).
Tests
New harness-context-compiler.test.ts (23 pins): catalog hygiene,
Widget wire-format single source (op7418#10), ordering, budget
enforcement, cross-runtime fragment identity (op7418#9), tool
descriptors, runtimeHints boundary (op7418#11), Expected Differences
Ledger consistency (op7418#12), JSON parseability of every artifact
contract.
New harness-context-compiler-equivalence.test.ts (9 pins):
compiler source reachability, runtime drift honesty,
ledger/slice ownership correctness, "post-slice-2d: Native
ledger holds only the follow_up MediaBlock entry".
Updated harness-capability-contract.test.ts: drift pins now
check (a) bridge holds no local _PROMPT scalars, (b) Native
builtin-tools re-export MCP canonicals, (c) unified-adapter
imports compileContext + consumes systemPromptText, (d)
claude-client.ts doesn't import from builtin-tools/* and
doesn't declare own _SYSTEM_PROMPT.
Updated codex-widget-format-contract.test.ts: the "WIDGET_SYSTEM_PROMPT
embeds WIDGET_WIRE_FORMAT_SPEC" and "appears inside
WIDGET_SYSTEM_PROMPT" pins are flipped — slice 2c REMOVED the
embed; the new pins verify the compiler-side import line.
Updated codex-builtin-bridge.test.ts: tests previously asserting
`bridge.systemPrompt` contained capability tags now assert it
equals `''` (bridge is no longer the prompt-assembly point).
Verification
CODEX_DISABLED=1 npx tsx --test \
src/__tests__/unit/harness-context-compiler.test.ts \
src/__tests__/unit/harness-context-compiler-equivalence.test.ts \
src/__tests__/unit/harness-capability-contract.test.ts \
src/__tests__/unit/codex-widget-format-contract.test.ts \
src/__tests__/unit/codex-builtin-bridge.test.ts
→ 74/74 pass
npm run test → 2576/2576 pass
Completion criteria check (per user spec)
[x] npm run test all green (2576/2576)
[x] Context Compiler unit tests all green
[x] equivalence / expected-diff harness all green
[x] harness-capability-contract / codex-widget-format /
codex-builtin-bridge tests all green
[x] no new runtime-local prompt duplicates (Native re-exports
canonical; ClaudeCode imports canonical; bridge holds none)
[x] Codex bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four removed,
drift test pins their absence)
[x] all three Runtimes adapt compiler output, none redefine
capability prompts
Docs
- phase-5d-phase-2-context-compiler.md: slice statuses 2a–2e all
✅ 2026-05-17; note the one-shot delivery mode change.
- phase-5d-harness-capability-contract.md: Phase 2 row ✅, awaiting
Codex review.
- handover/harness-capability-contract.md: new "Context Compiler"
section detailing inputs/outputs/constraints, three-runtime
consumption pattern, Expected Differences Ledger contract.
- refactor-closeout.md: new decision-log entry recording the
Phase 2 delivery shape + completion criteria check.
Phase 5d Phase 2 ✅ pending Codex review. Phase 3 (Runtime
Capability Adapter) / Phase 4 (Artifact Contract) / Phase 5
(new-Runtime Playbook) intentionally NOT opened — stopping per
user instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t1tuesr@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

feat: add proxy configuration support for all network access - #9

Closed
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd
Closed

feat: add proxy configuration support for all network access#9
t1tuesr wants to merge 2 commits into
op7418:mainfrom
t1tuesr:claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd

Conversation

@t1tuesr

Copy link
Copy Markdown

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY) are injected into the Claude Code subprocess, and Electron's session proxy is also set for renderer network requests.

https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz

Allow users to configure an HTTP/HTTPS/SOCKS5 proxy from the Settings
page. When enabled, proxy env vars (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY,
NO_PROXY) are injected into the Claude Code subprocess, and Electron's
session proxy is also set for renderer network requests.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
A minimal HTTP CONNECT proxy that logs all requests passing through it,
making it easy to confirm Claude API traffic is routed via the proxy.
https://claude.ai/code/session_01GMvWD4Su1iRwjvLytHppEz
@t1tuesrt1tuesr closed this Feb 7, 2026
@t1tuesr
t1tuesr deleted the claude/explain-codebase-mlcgkrh5tqlsxr3t-LHfNd branch February 7, 2026 15:39
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt #9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
op7418 added a commit that referenced this pull request Apr 19, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt #8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt #9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 op7418#2 补充连续水位推进机制
- 新增决策 op7418#9(图片接收)和 op7418#10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
Layout, plugins, settings, skills, project-panel, and visual-regression
all test UI that was rewritten since these specs were authored: the
old <aside> toggle with sr-only "Toggle sidebar", the "Plugins & Skills"
landing page, the pre-PanelZone right panel, the V2 settings shell with
"Visual Editor" / "JSON Editor" tabs, the /settings?tab=skills editor,
and baseline PNGs (which shouldn't be committed anyway) are all gone
or relocated.
Rather than half-fixing selectors one test at a time, each describe
block is marked `test.describe.skip` with a Chinese/English note
pointing to tech debt op7418#9, which tracks the full rewrite against the
current UI. A few individual tests are also skipped:
- chat.spec `send a message and see it in the conversation` — needs a
mocked stream; flakes against live provider and the /chat → /chat/[id]
redirect race.
- chat-enhanced.spec `code blocks have dark background header bar` —
same live-provider dependency.
- mention-ui.spec — two heavy integration flows that open the @ picker
then click chips; unit tests in message-input-interactions.test.ts
already cover the serialization + chip-order invariants.
Remaining adjustments:
- helpers.newChatButton now matches either `<a>` or `<button>` (the
sidebar renders it as a button now) with zh/en text.
- chat.spec empty-state uses role=heading instead of a fixed `h2`; the
heading level drifted between h2/h3 during the recent layout work.
- layout.spec "sidebar has New Chat button" switched to the same
button|link locator so it stops depending on the helper's role cast.
Result: npm run test:e2e → 45 passed, 111 skipped, 0 failed in 1.3 min.
Unit and smoke gates unchanged (1084/6 passing).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
**global-search-modes.spec.ts**: the all-mode file-result assertion was
still failing on populated DBs. The /api/search file branch iterates
every session's working_directory via scanDirectory — with ~30
pre-existing sessions in a real dev DB the request comfortably exceeds
Playwright's default 5s toBeVisible timeout before the unique-suffix
match lands. Bump just that assertion to 30s; the others stay on the
default so a genuinely broken search path still fails fast.
**chat.spec.ts**: "conversation appears in sidebar after response" was
the last real-provider-dependent test. It races with the /chat → /chat/[id]
redirect and needs a live stream to finish. Skipped with the same note
as the other mocked-stream-needed tests.
**RELEASE_NOTES.md**: new "已知限制" section calling out the three items
Codex wanted surfaced instead of silently absorbed —
- @file/@Directory mentions ignore space-containing paths (debt op7418#8)
- E2E coverage is reduced: ~110 quarantined specs against removed UI,
layout/plugins/settings regressions won't be caught by the gate
until the rewrite (debt op7418#9)
- Turbopack still emits one NFT warning for instrumentation.js; build
passes, NFT manifest isn't used in the Electron pipeline
Final gate: 1084 unit, 6 smoke, 44 E2E pass · 112 skip · 0 fail · 55s.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
youcho2 pushed a commit to youcho2/CodePilot that referenced this pull request Aug 11, 2026
User mode change: "internal slice order preserved, external single
delivery; stop only after Phase 2 is done; Codex review takes the
batch." This commit lands slices 2a–2e together with all post-
review hardenings (Widget wire-format single source, Expected
Differences Ledger, runtimeHints prose ban).
Internal slice walk
2a — context-compiler.ts (NEW)
Pure function `compileContext(input): CompiledContext`. No IO,
no provider calls. Resolves enabledCapabilities (null = catalog
live default), looks up exposure for the calling runtime, emits
capabilityFragments + artifactContracts + memory + workspace +
toolDescriptors + runtimeHints + budget + systemPromptText +
diagnostics. Hard contracts: artifactContract before capability
in the assembled prompt; fragmentId uniqueness; cross-runtime
fragment text identity; compile-time FAIL if a capability
fragment text contains an artifact contract canonicalJson
(wire-format dedup); compile-time FAIL if load-bearing fragments
exceed budget. runtimeHints types strictly ID/refs/adapter
options — no prose, no template literals.
2b — expected-differences.ts (NEW)
Drift ledger. Initial 4 entries from slice 7b tech-debt. Three
slice_2d entries consumed by this commit (see 2d below); the
one remaining `follow_up` is image_generation MediaBlock shape
(non-prompt, future slice).
2c — ClaudeCode SDK (claude-client.ts) source-pin only
The SDK path has always imported MCP canonicals directly
(memory-search-mcp, notification-mcp, media-import-mcp,
cli-tools-mcp, dashboard-mcp) — no paraphrase ever existed.
Slice 2c codifies this with a contract test: claude-client.ts
must not import capability prompts from builtin-tools/* and
must not declare its own _SYSTEM_PROMPT scalars.
2d — Native Runtime (builtin-tools/*) re-export MCP canonicals
`memory-search.ts` now `export const MEMORY_SEARCH_SYSTEM_PROMPT =
CANONICAL_MEMORY_SEARCH_SYSTEM_PROMPT` (imported from
memory-search-mcp.ts). Same pattern for `notification.ts`
(NOTIFICATION_SYSTEM_PROMPT = NOTIFICATION_MCP_SYSTEM_PROMPT)
and `media.ts` (MEDIA_SYSTEM_PROMPT = MEDIA_MCP_SYSTEM_PROMPT
from media-import-mcp.ts). Three ledger entries removed in
sync.
2e — Codex bridge (builtin-bridge.ts + unified-adapter.ts)
Bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four declarations
deleted). `createCodePilotBuiltinTools().systemPrompt` is
permanently `''`. `unified-adapter.ts` now calls
`compileContext({ runtimeId: 'codex_runtime', ... })` and feeds
`compiled.systemPromptText` to Codex's `instructions`. A new
helper `capabilitiesFromBridgeToolNames` maps the bridge's
mounted tool names back to capability ids so the compiler's
enabledCapabilities aligns with what the bridge actually
exposes (workspace-gated memory tools naturally drop out when
workspacePath is empty).
Slice 2c Widget wire-format single source (review revision op7418#1)
WIDGET_SYSTEM_PROMPT in widget-guidelines.ts no longer
template-literal-embeds `${WIDGET_WIRE_FORMAT_SPEC}`. The
artifactContract is now the sole holder of the wire-format spec
+ canonical JSON. Compiler's `detectWireFormatDuplication` sanity
check throws at compile time if any capability fragment text
contains the artifact contract canonicalJson — that's the forcing
function preventing the spec from being re-injected.
Three regression pins enforce single occurrence in the compiled
prompt: CANONICAL_SHOW_WIDGET_JSON × 1, "FINAL OUTPUT FORMAT —
non-negotiable" × 1, WIDGET_WIRE_FORMAT_SPEC × 1.
runtimeHints boundary (review revision op7418#3)
ClaudeCodeHints / NativeHints / CodexProxyHints types now carry
only IDs (mcp server names, tool keys, builtin tool name set) +
adapter options (stopWhen, stepCount, passthroughToolTypes).
Tests pin: type-level (no string field > 64 chars, no newline,
no Markdown markers), runtime-level (scan all string values for
prose), source-grep (CodexProxyHints type definition can't
contain `promptOverride` / `promptExtra` / `widgetPrompt` / etc).
Tests
New harness-context-compiler.test.ts (23 pins): catalog hygiene,
Widget wire-format single source (op7418#10), ordering, budget
enforcement, cross-runtime fragment identity (op7418#9), tool
descriptors, runtimeHints boundary (op7418#11), Expected Differences
Ledger consistency (op7418#12), JSON parseability of every artifact
contract.
New harness-context-compiler-equivalence.test.ts (9 pins):
compiler source reachability, runtime drift honesty,
ledger/slice ownership correctness, "post-slice-2d: Native
ledger holds only the follow_up MediaBlock entry".
Updated harness-capability-contract.test.ts: drift pins now
check (a) bridge holds no local _PROMPT scalars, (b) Native
builtin-tools re-export MCP canonicals, (c) unified-adapter
imports compileContext + consumes systemPromptText, (d)
claude-client.ts doesn't import from builtin-tools/* and
doesn't declare own _SYSTEM_PROMPT.
Updated codex-widget-format-contract.test.ts: the "WIDGET_SYSTEM_PROMPT
embeds WIDGET_WIRE_FORMAT_SPEC" and "appears inside
WIDGET_SYSTEM_PROMPT" pins are flipped — slice 2c REMOVED the
embed; the new pins verify the compiler-side import line.
Updated codex-builtin-bridge.test.ts: tests previously asserting
`bridge.systemPrompt` contained capability tags now assert it
equals `''` (bridge is no longer the prompt-assembly point).
Verification
CODEX_DISABLED=1 npx tsx --test \
src/__tests__/unit/harness-context-compiler.test.ts \
src/__tests__/unit/harness-context-compiler-equivalence.test.ts \
src/__tests__/unit/harness-capability-contract.test.ts \
src/__tests__/unit/codex-widget-format-contract.test.ts \
src/__tests__/unit/codex-builtin-bridge.test.ts
→ 74/74 pass
npm run test → 2576/2576 pass
Completion criteria check (per user spec)
[x] npm run test all green (2576/2576)
[x] Context Compiler unit tests all green
[x] equivalence / expected-diff harness all green
[x] harness-capability-contract / codex-widget-format /
codex-builtin-bridge tests all green
[x] no new runtime-local prompt duplicates (Native re-exports
canonical; ClaudeCode imports canonical; bridge holds none)
[x] Codex bridge no longer holds WIDGET_PROMPT / MEDIA_PROMPT /
MEMORY_PROMPT / NOTIFY_PROMPT scalars (all four removed,
drift test pins their absence)
[x] all three Runtimes adapt compiler output, none redefine
capability prompts
Docs
- phase-5d-phase-2-context-compiler.md: slice statuses 2a–2e all
✅ 2026-05-17; note the one-shot delivery mode change.
- phase-5d-harness-capability-contract.md: Phase 2 row ✅, awaiting
Codex review.
- handover/harness-capability-contract.md: new "Context Compiler"
section detailing inputs/outputs/constraints, three-runtime
consumption pattern, Expected Differences Ledger contract.
- refactor-closeout.md: new decision-log entry recording the
Phase 2 delivery shape + completion criteria check.
Phase 5d Phase 2 ✅ pending Codex review. Phase 3 (Runtime
Capability Adapter) / Phase 4 (Artifact Contract) / Phase 5
(new-Runtime Playbook) intentionally NOT opened — stopping per
user instruction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t1tuesr@claude