Commit Graph

443 Commits

Author SHA1 Message Date
Huang richao
446d7bf549 Merge remote-tracking branch 'origin/main' into feat/macos-desktop-app 2026-04-24 17:53:18 +08:00
Huang richao
b34965b936 fix: narrow macOS app installer per review 2026-04-24 17:52:47 +08:00
Liang Jiaqing
ee899d4dd5 fix(tgapp): remove hardcoded proxy default, use mykey.py config instead
The proxy was hardcoded to http://127.0.0.1:2082 which breaks for users
without a local proxy (e.g. international users with direct access).
Now defaults to None; users who need a proxy can set it in mykey.py.
2026-04-24 17:30:48 +08:00
Liang Jiaqing
888ce2f9bb fix(pyproject): correct dingtalk-stream version constraint (>=0.20, was >=1.0 which does not exist on PyPI) 2026-04-24 17:24:09 +08:00
LJQ
e2a57e7a32 Merge pull request #153 from ViviqwerAsd/feat/fsapp-add-llm-command
feat(fsapp): add /llm command support for model switching
2026-04-24 16:01:14 +08:00
Xinyi Wang
a6644d580c feat(fsapp): add /llm command support for model switching
- Add /llm command to list available models
- Add /llm [n] command to switch to specific model
- Improve /status command to show current LLM info with emoji indicators
- Update /help text to include /llm command
- Unify command parsing logic using parts and op variables

This brings fsapp.py (Feishu/Lark) frontend in line with other chat frontends (QQ, DingTalk, WeCom) that already support all slash commands.
2026-04-24 04:20:16 -03:00
LJQ
883366ce55 Merge pull request #148 from AspasZhang/docs/update-wechat-qr-codes-v3
docs: update WeChat community group QR codes (remove 6&10, add 11)
2026-04-24 12:32:00 +08:00
AspasZhang
be2386661d docs: update WeChat community group QR codes (remove 6&10, add 11) 2026-04-24 11:08:20 +08:00
Liang Jiaqing
12c2fe1f79 add uv install guide & pyproject.toml; unify error prefix to !!!Error: 2026-04-24 10:00:23 +08:00
Liang Jiaqing
f334994ab6 fix: thinking非空时不再误判为空响应触发重试 2026-04-24 10:00:23 +08:00
LJQ
6974853695 Merge PR #144: style: 重构并优化 qtapp 桌面窗口样式与交互功能
style: 重构并优化 qtapp 桌面窗口样式与交互功能
2026-04-24 09:26:08 +08:00
YooooEX
f516c52a72 feat(tgapp): stream MarkdownV2 replies with draft fallback and file segments (#135) 2026-04-24 09:01:49 +08:00
wellsoren
8065c0d759 style: 重构并优化 qtapp 桌面窗口样式与交互功能 2026-04-24 01:50:09 +08:00
Liang Jiaqing
fd46d61543 fix: SSE tool_call streaming compat for non-standard index/id, MockToolCall handle list args & None fallback; sop: CDP bringToFront note 2026-04-23 23:44:50 +08:00
Huang richao
7255515607 feat: add macOS Desktop App installation script
- Add scripts/install-macos-app.sh for one-click macOS app installation
- Uses bundled assets/images/logo.jpg as app icon
- AppleScript prompts for project folder on first run
- Updates README with macOS Desktop App installation option
- Supports both interactive and --auto non-interactive modes

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-23 23:19:24 +08:00
Liang Jiaqing
8a6a5715ff Fix responses call_id mapping for converted tool history 2026-04-23 20:53:44 +08:00
Liang Jiaqing
df2a7749b4 refactor: unify system prompt injection into _openai_stream; disable gpt done_hooks 2026-04-23 20:07:20 +08:00
Jiaqing Liang
6091bf0c6f fix: add requests to pip install & tune max_turns/prompt 2026-04-23 17:21:22 +08:00
weijia
fd4c833511 feat(stapp): restore chat history bubbles after /continue N (#138)
When the user runs '/continue N' in stapp, the agent's in-memory context
is restored, but the UI previously showed only a single ' restored' line
— all prior chat bubbles were missing.

This change parses the target session log and reconstructs the
user/assistant message pairs into st.session_state.messages, so reopening
a session feels like the conversation was never interrupted.

* continue_cmd.py: add extract_ui_messages(path)
  - parses model_responses log into [{role, content}, ...]
  - groups multi-turn LLM calls (prompts whose text starts with the
    '### [WORKING MEMORY]' header) into a single assistant bubble,
    inserting the existing '**LLM Running (Turn N) ...**' marker so
    fold_turns() renders them as collapsible segments.
  - two small helpers (_user_text / _assistant_text) keep parsing local.

* stapp.py: in the /continue branch, resolve the target log path BEFORE
  calling handle_frontend_command (which snapshots the current log and
  would otherwise shift list_sessions indices), then replace
  session_state.messages with the reconstructed history on success.
  Falls back to the previous behavior for bare /continue or failure.

Co-authored-by: wjl2023 <wjl2023@users.noreply.github.com>
2026-04-23 16:36:41 +08:00
Liang Jiaqing
1678114f1f fix: split concatenated JSON tool args in _parse_openai_sse to prevent _raw death spiral 2026-04-23 11:53:35 +08:00
Liang Jiaqing
97573e6f46 fix: agent-level retry for intermittent SSL errors during streaming
- llmcore: prefix all error outputs with !!! marker
- ga: detect !!!Error: [SSL: in tail of content as incomplete response and retry
- add len(content)>100 guard to avoid false positives on short responses
2026-04-23 11:24:54 +08:00
Liang Jiaqing
17971f642a fix: guard all id/call_id fields with or "" to prevent None leaking into payload 2026-04-23 11:00:04 +08:00
Liang Jiaqing
a53b7a8593 refine L0 sync rule: default L3, bracket trigger words only for non-intuitive scenarios 2026-04-22 19:49:27 +08:00
Liang Jiaqing
08c583d1c6 fix: filter empty text blocks in message conversion & add prompt continuation line 2026-04-22 19:37:06 +08:00
LJQ
928633e4b2 Merge pull request #134 from shenhao-stu/main
template: upload mykey_template_en.py
2026-04-22 19:11:43 +08:00
Shen Hao
542aa89130 template: add mykey_template_en.py 2026-04-22 19:09:07 +08:00
Shen Hao
eb2a3bf824 template: add Kimi for Coding configuration 2026-04-22 19:05:40 +08:00
Liang Jiaqing
274d47f35f Normalize OAI messages before conversion and update tool-call prompt 2026-04-22 17:16:05 +08:00
weijia
b34cffe801 feat(fsapp): render agent run as one continuously-updating Feishu card (#131)
Rework the Feishu frontend so each user turn renders as a single
collapsible task card that patches itself in place, replacing the
dq-based streaming path that produced many fragmented messages.

- One _TaskCard per turn; hook reacts to summary / exit_reason events
  from the agent loop and patches the same card.
- Each step is a foldable panel: header shows the summary, expanding
  reveals three sections (auto-hidden when empty):
    * Thinking   - from response.thinking (separate field, not content)
    * Tool Calls - tool name + truncated JSON args
    * Output     - response.content, with protocol tags stripped so
                   the header summary is not duplicated inside
- Final reply rendered as a schema 2.0 markdown card for consistency.
- Code-review pass per code_review_principles.md:
    * _TaskCard owns only stateful card lifecycle (start/step/done/fail)
    * Pure formatting extracted to module-level _build_step_detail and
      _fmt_tool_call (no more reaching into card._private from the hook)
    * Hook is a ~10-line dispatcher
    * Flattened a 4-level nested lambda into a named function
2026-04-22 14:12:51 +08:00
Liang Jiaqing
132edb3154 improve GPT done_hook: require informative summary on completion 2026-04-22 10:53:29 +08:00
Liang Jiaqing
7b2ff1e73a feat(tgapp): handle photo messages, pass temp path to agent 2026-04-21 23:39:46 +08:00
LJQ
f1db2e56df feat: add Telegram slash command parity and menu sync (#125)
feat: add Telegram slash command parity and menu sync
2026-04-21 23:14:38 +08:00
song
f14ad0c693 fix(llmcore): preserve thinking block signature in streaming SSE parser (#123)
Anthropic's extended thinking streaming protocol emits two delta types
for a single thinking block: `thinking_delta` (the textual reasoning)
and `signature_delta` (a base64 HMAC tag appended at the end of the
block). Both must be accumulated into the same `content_block`.

Current code only handles `thinking_delta`, so `signature_delta` events
are silently dropped. When the assistant's reply (with thinking) is
echoed back on the next turn, Anthropic's server validates the
signature and rejects the request with 400:

    "Invalid `signature` in `thinking` block"

Downstream effects observed in production (via sub2api relay logs):
- Every request with history triggers a 400 signature error
- The relay strips thinking blocks and retries, which changes the
  cache prefix and invalidates prompt caching, forcing a full rebuild
  of cache_creation_tokens (~20k-30k per affected request)
- Measured in a 5h window: 5/25 requests suffered cache invalidation,
  accounting for 53.5% of total spend that was otherwise avoidable

Fix:
1. Initialize `current_block` with an empty `signature` field when a
   thinking block starts, so the dict shape matches Anthropic's spec
   (`{type, thinking, signature}`).
2. Handle `signature_delta` events by appending `delta.signature` to
   `current_block["signature"]`. Using `+=` (rather than assignment)
   mirrors how `thinking_delta` is accumulated and is robust against
   future chunked signatures.

No behavior change for clients that disable extended thinking, or for
upstreams that don't emit `signature_delta`. For `tool_use` threads
that require valid thinking signatures to preserve reasoning context,
this fix is required — the previous behavior silently corrupted them.

Verification:
- Before fix: upstream returns 400 + retry; cache_creation_tokens
  spike to ~25k on every 4th-5th request in a conversation
- After fix: upstream accepts the first attempt; cache_read_tokens
  dominate, cache_creation_tokens only appear on the first request
  of a fresh 5m prompt-cache window
2026-04-21 12:07:14 +08:00
LJQ
7ce39e29d0 Merge pull request #124 from ViviqwerAsd/docs/update-wechat-qr-codes-v2
docs: update WeChat community group QR codes
2026-04-21 11:52:37 +08:00
Xinyi Wang
09a78573f5 docs: update WeChat community group QR codes
- Replace 3 old QR codes (group 5/6/7) with 4 new ones (group 6/8/9/10)
- Update both English and Chinese sections in README.md
- Remove obsolete wechat_group5.jpg and wechat_group7.jpg
- Add wechat_group8.jpg, wechat_group9.jpg, wechat_group10.jpg
2026-04-21 11:47:55 +08:00
YooooEX
ef9d218f91 feat: add Telegram slash command parity and menu sync 2026-04-21 11:43:53 +08:00
Liang Jiaqing
055fe882fc docs: add arXiv link (2604.17091) to README 2026-04-21 10:57:51 +08:00
Liang Jiaqing
d25cfa5a2a refactor: vision_sop精简改写 + 新增vision_api.template.py 2026-04-20 23:22:36 +08:00
Liang Jiaqing
5c1dd1270c refactor stapp rerun reset logic and simplify vision SOP 2026-04-20 21:10:49 +08:00
LJQ
bf4bc5d2ea feat: add /continue and /new command support to all chat frontends (#120)
feat: add /continue and /new command support to all chat frontends
2026-04-20 21:01:09 +08:00
Xinyi Wang
d1a491ff3b feat: add continue/new support to chat frontends 2026-04-20 19:27:31 +08:00
Jiaqing Liang
db3a807141 docs: add link to Datawhale hello-generic-agent tutorial 2026-04-20 16:26:07 +08:00
Jiaqing Liang
116d7d3d23 refactor: plugins dir + opt-in langfuse via __getattr__ guard
- mv langfuse_tracing.py -> plugins/langfuse_tracing.py
- llmcore: load plugin lazily inside __getattr__ when langfuse_config present
  (PEP 562 module __getattr__ naturally fires only once after globals().update)
- llmcore: extract _record_usage() from 4 scattered [Cache] print sites
- agentmain: /resume scans only latest 10 files
2026-04-20 15:56:06 +08:00
totoyang
8e6270e3a3 feat: optional Langfuse tracing for agent execution (#115)
Self-activating langfuse tracing via monkey-patch: independent module, zero impact when langfuse_config unset. Captures LLM generation, tool calls, token usage from SSE streams.

Co-authored-by: totoyang
2026-04-20 15:27:55 +08:00
Jiaqing Liang
adc702d3f8 docs: add GitHub badge linking to GA-Technical-Report (data & reproduction repo) 2026-04-20 12:37:17 +08:00
Jiaqing Liang
765fcb6c2e docs: move disclaimer to License section (less intrusive) 2026-04-20 12:19:29 +08:00
Jiaqing Liang
ae796482e8 docs: add disclaimer about unofficial commercial sites 2026-04-20 12:17:28 +08:00
Liang Jiaqing
63c7c83c51 refactor: update agent loop and tool extraction 2026-04-19 23:21:37 +08:00
Liang Jiaqing
86ca4625ad refactor: simplify HTTP error handling in _openai_stream, add non-stream support, broadcast history in MixinSession 2026-04-19 20:57:07 +08:00
LJQ
d1f4ee9aaf Merge pull request #112 from shenhao-stu/main
feat: add /continue cmd
2026-04-19 19:15:41 +08:00