| merge: resolve conflicts with openbmb/main
Keep _placeholder bootstrap config, drop upstream comments per project style.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 6 天前 |
| fix(model): make provider credentials whitespace-tolerant + per-turn config refetch
A stray space in a YAML quoted apiKey (apiKey: " sk-...") survived all
the way to the wire as Authorization: Bearer sk-..., which most
providers reject as invalid_token / 无效的令牌. Even after the user
"fixed" it via the UI a copy-paste with leading/trailing whitespace
would re-introduce the same footgun.
Defence in depth:
- resolveApiKey trims the literal value and any ${VAR}-resolved env
value; whitespace-only is still rejected as missing_api_key.
- parseProvider trims provider.url so a stray newline in a baseURL
doesn't break URL construction either.
- streamModel.buildHeaders trims apiKey one more time at the wire
boundary as a defence against callers that bypass parseModelConfig.
- ui/server sanitises provider.apiKey/url before writing to disk so
the saved yaml stays diff-clean and watcher-friendly.
Per-turn config refresh hook so an apiKey edit takes effect on the
very next message even when the fs watcher misses an event (network
mounts, debounce gaps, container snapshots): InProcessGateway gains
an optional refreshConfigBeforeTurn hook awaited at the top of
submitTurn; createLocalGateway wires it to configStore.reload, which
is singleton-deduped and a no-op when the yaml hasn't changed.
Tests cover whitespace tolerance (literal + env, openai + anthropic
header paths), url trim, and the per-turn refresh ordering + error
swallow. 116 model+gateway tests pass / 0 fail.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 18 天前 |
| chore(branding): complete cleanup of legacy CloudCLI/Claude Code references
- CLOUDCLI_DISABLE_LOCAL_AUTH → PILOTDECK_DISABLE_LOCAL_AUTH
- CLOUDCLI_CRON_DAEMON_* → PILOTDECK_CRON_DAEMON_*
- CLOUDCLI_GITHUB_STARS → PILOTDECK_GITHUB_STARS
- ~/.claude-code-ui/plugins/ → ~/.pilotdeck/plugins/
- claudecodeui-server → pilotdeck-server
- edgeClawConfig i18n key → pilotDeckConfig (248 refs in TSX + settings.json)
- claude-code-main source provenance comments → generic descriptions
- CloudCLI user-facing strings → PilotDeck
- DEFAULT_PROVIDER_FALLBACK "edgeclaw" → "pilotdeck"
- .claude/ config home → .pilotdeck/ in cron daemon services
Co-authored-by: Cursor <cursoragent@cursor.com>
| 9 天前 |
| fix(model): deep-clone nested content in cloneMessages
cloneMessages used spread to shallow-copy content blocks, leaving
CanonicalToolResultBlock.content and CanonicalToolCallBlock.input
as shared references between original and clone. Extract a shared
clone utility that deep-copies these nested structures and replace
three duplicate private implementations.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 8 天前 |
| Drop orphaned OpenAI tool results
Co-authored-by: Cursor <cursoragent@cursor.com>
| 5 天前 |
| feat: add model runtime foundation
Co-authored-by: Cursor <cursoragent@cursor.com>
| 26 天前 |
| refactor: enhance token usage normalization and cost calculations
Updated the normalizeOpenAIUsage function to improve token calculations by introducing cache read and write tokens. Adjusted the TokenStatsCollector to account for cache write costs in total calculations and refined baseline cost handling. This ensures more accurate cost estimations and better reflects usage metrics.
| 12 天前 |
| feat(model): extract tool calls from raw text for non-conformant models
Add parseTextToolCalls module that recognizes Qwen XML, DeepSeek DSML,
Hermes JSON-in-XML, Mistral [TOOL_CALLS], and Llama python_tag formats.
Wire it into assembleModelMessage as a fallback when no structured tool
calls are present. Add PILOTDECK_DUMP_REQUEST env for request debugging.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 15 天前 |
| refactor: rename Polit/PolitDeck to Pilot/PilotDeck across entire codebase
Automated global rename covering all case variants:
- PolitDeck → PilotDeck, politdeck → pilotdeck, POLITDECK → PILOTDECK
- Polit → Pilot, polit → pilot, POLIT → PILOT, politDeck → pilotDeck
Includes:
- 648 content replacements across 200+ source files
- 24 file renames + 3 directory renames (src/polit→pilot, tests/polit→pilot, docs/polit-config→pilot-config)
- package.json name, bin, env vars updated
- package-lock.json regenerated
- "Politely" in server-manager.ts preserved via placeholder mechanism
- All 587 unit tests pass, tsc --noEmit clean
- E2E tests verified against real OpenRouter API (model, tool-use, context, lifecycle hooks)
Co-authored-by: Cursor <cursoragent@cursor.com>
| 24 天前 |
| feat(agent): add multimodal image support to readFile and tool context
Extend read_file to detect image files and return base64 image blocks
when the model supports image input, with a text-only fallback otherwise.
Thread modelMultimodal constraints from ModelRuntime through AgentLoop
and tool context so tools can adapt their output format. Extract
inline image blocks from tool results into user messages for models
that accept interleaved image content.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 16 天前 |
| fix(model): deep-clone nested content in cloneMessages
cloneMessages used spread to shallow-copy content blocks, leaving
CanonicalToolResultBlock.content and CanonicalToolCallBlock.input
as shared references between original and clone. Extract a shared
clone utility that deep-copies these nested structures and replace
three duplicate private implementations.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 8 天前 |