Skip to content

feat: add WorkBuddy agent support#525

Open
arbing wants to merge 4 commits into
kenn-io:mainfrom
arbing:workbuddy
Open

feat: add WorkBuddy agent support#525
arbing wants to merge 4 commits into
kenn-io:mainfrom
arbing:workbuddy

Conversation

@arbing
Copy link
Copy Markdown

@arbing arbing commented May 21, 2026

  • Register WorkBuddy as the agent type for Tencent Cloud CodeBuddy's office AI agent product.
  • Use https://www.codebuddy.cn/work/ as the product reference for the WorkBuddy integration context.
  • Parse WorkBuddy JSONL transcripts, including user and assistant messages, tool calls, tool results, token usage, and subagent relationships.
  • Discover WorkBuddy project sessions under .workbuddy/projects and wire them into incremental sync and source lookup.
  • Expose WorkBuddy in README, CLI environment variable help, settings, and frontend agent metadata.

- Register WorkBuddy as the agent type for Tencent Cloud CodeBuddy's office AI agent product.
- Use https://www.codebuddy.cn/work/ as the product reference for the WorkBuddy integration context.
- Parse WorkBuddy JSONL transcripts, including user and assistant messages, tool calls, tool results, token usage, and subagent relationships.
- Discover WorkBuddy project sessions under .workbuddy/projects and wire them into incremental sync and source lookup.
- Expose WorkBuddy in README, CLI environment variable help, settings, and frontend agent metadata.
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 21, 2026

roborev: Combined Review (3a85067)

Summary verdict: One medium issue found; security review reported no issues.

Medium

  • Location: internal/parser/workbuddy.go (ParseWorkBuddySession, case "message":)
  • Problem: Token usage is not extracted for standard assistant text responses. applyWorkBuddyUsage is only called for function_call events, so token metrics included in regular assistant message blocks are dropped.
  • Fix: Call applyWorkBuddyUsage(&msg, root) for message events when role == RoleAssistant before appending the message.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

arbing added 2 commits May 21, 2026 14:24
- Extract token metrics from regular WorkBuddy assistant message events, not only tool-call events.
- Cover assistant text response usage so session totals include both text and tool-call output tokens.
- Point the WorkBuddy projects directory to the empty e2e fixture directory.
- Prevent the test server from reading real local WorkBuddy sessions.
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 21, 2026

roborev: Combined Review (fba5b3e)

Summary verdict: One medium issue should be fixed before merge; no high or critical findings were reported.

Medium

  • internal/parser/workbuddy.go:361: OpenAI-style rawUsage can provide both prompt_tokens and prompt_tokens_details.cached_tokens. Since cached tokens are already included in prompt_tokens, ContextTokens adds them again, inflating per-message and session totals.
    • Fix: Track the usage shape and either keep ContextTokens as prompt_tokens for OpenAI-style usage, or normalize input_tokens to exclude cached tokens before adding cache fields.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

- Normalize OpenAI-style prompt tokens to avoid double-counting cached tokens
- Add a WorkBuddy rawUsage regression test for cached token totals
@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 21, 2026

roborev: Combined Review (0f4baf1)

Summary verdict: No Medium, High, or Critical findings to report.

All reported findings are Low severity, and security review found no issues.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@roborev-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 21, 2026

roborev: Combined Review (0f4baf1)

Summary verdict: One medium issue remains around WorkBuddy file watching; lower-severity findings omitted.

Medium

  • Location: internal/parser/types.go:331
  • Problem: WorkBuddy is registered with ShallowWatch: true, but its session files live under nested paths like <projects>/<project>/... and <projects>/<project>/<session>/subagents/.... Watching only the root ~/.workbuddy/projects may miss fsnotify events for nested session files, and because the root is considered watched, it may also bypass the unwatched polling path.
  • Fix: Use recursive watching for WorkBuddy, or add a WorkBuddy-specific watcher strategy that watches project/session subdirectories or explicitly polls this root.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

Sign up for free to 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.

1 participant