Skip to content

feat: Zalo Bot Platform, Party Mode, team auth + merge upstream#162

Open
duhd-vnpay wants to merge 8 commits intonextlevelbuilder:mainfrom
duhd-vnpay:fix/delegate-subagent-announce-routing
Open

feat: Zalo Bot Platform, Party Mode, team auth + merge upstream#162
duhd-vnpay wants to merge 8 commits intonextlevelbuilder:mainfrom
duhd-vnpay:fix/delegate-subagent-announce-routing

Conversation

@duhd-vnpay
Copy link

@duhd-vnpay duhd-vnpay commented Mar 12, 2026

Summary

  • Zalo Bot Platform API compatibility — struct tags (account_name, display_name), multi-format getUpdates parser, CDN photo download with fallback
  • Party Mode — multi-persona collaborative discussion engine (backend + full UI)
  • Team auth — sender_id tracking for team tasks authorization + thinking model prefill fix
  • Merged upstream main — 70+ commits including contacts, activity tracking, knowledge graph, mobile UX, budget enforcement, skills system, trace export

Conflict Resolution

Area Resolution
zalo.go Kept local struct tags + upstream's n==0 safety check
channel_instances.go Used upstream's credential merging (supersedes local bytea fix)
factory.go, stores.go Merged Party + Contacts/Activity/Snapshots stores
session_store.go, manager.go, sessions_ops.go Deduplicated SetHistory()
sidebar.tsx, routes.tsx Added Party to upstream's restructured sidebar/routes
protocol.ts, i18n (6 files) Merged Party + upstream events/translations
Migration collision Renamed 000014_party_sessions000018_party_sessions
version.go Schema version = 18

Test plan

  • go build ./... passes (verified in Docker golang:1.26)
  • No conflict markers remaining (verified via grep)
  • Migration sequence 001–018 is contiguous
  • Party Mode UI renders at /party
  • Sidebar shows Party in Core group
  • Zalo Bot Platform struct tags parse correctly
  • Team tasks respect sender_id authorization

🤖 Generated with Claude Code

duhd-vnpay and others added 8 commits March 10, 2026 15:44
…ing, photo handling

- Fix zaloBotInfo to use account_name/display_name (not name)
- Add Label() method for bot display name resolution
- Handle 3 response formats in getUpdates: array, single object, wrapped
- Add photo_url field to zaloMessage for Zalo CDN image URLs
- Add display_name/is_bot to zaloFrom, chat_type to zaloChat
- Use PhotoURL with fallback to Photo in handleImageMessage

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ssing

Zalo CDN URLs are auth-restricted and expire quickly, causing read_image
tool failures. Now downloads photos to temp files (like Telegram channel)
so the agent pipeline can base64-encode and process them normally.

Falls back to passing the URL directly if download fails.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
… instance updates

When encryption key is empty, credentials stayed as map[string]any from
JSON unmarshal, causing pgx driver to fail encoding into bytea. Now
credentials are always marshaled to []byte regardless of encryption.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add Party Mode to GoClaw: structured multi-persona AI discussions with
Standard (single LLM call), Deep (parallel thinking + cross-talk), and
Token-Ring (sequential turns) modes.

Backend: PartyStore + PG implementation, party engine with parallel
goroutines, 7 RPC methods (party.start/round/question/add_context/
summary/exit/list), 10 WebSocket events, migration 000014.

Frontend: React dashboard page with session list, chat view, persona
sidebar, mode controls, start dialog with 6 team presets, i18n (en/vi/zh).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Previously, sanitizeHistory() only cleaned the in-memory copy for each
LLM request but never persisted the fix — causing the same "dropping
orphaned tool message" WARN to repeat on every single request forever.

Changes:
- sanitizeHistory() now returns drop count alongside cleaned messages
- When orphans are detected, cleaned history is persisted back to the
  session store via new SetHistory() method, then saved to DB
- Per-message WARN logs downgraded to DEBUG (cleanup is logged once
  at INFO level with total count)
- Added SetHistory() to SessionStore interface + both implementations

Co-Authored-By: Claude Opus 4.6 <[email protected]>
When a delegated agent (e.g. ui-ux-design-agent) spawns subagents, the
announce session key uses the format delegate:{uuid8}:{agentKey}:{id}.
The scheduler's RunFunc only handled agent:{agentId}:{rest} format,
falling back to the hardcoded "default" agent — which doesn't exist in
managed-mode deployments where the default agent has a custom key.

Add delegate: prefix parsing to extract the target agent key from
position 2 of the session key parts.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Add sender_id and channel to team task metadata for audit trail
- Remove assistant prefill in team task reminder (thinking models reject it)
- Add unit tests for team access control and sender_id tracking

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…, mobile UX, budget, traces)

Resolved 13 file conflicts:
- zalo.go: kept local struct tags + upstream's n==0 safety check
- channel_instances.go: used upstream's credential merging (supersedes local bytea fix)
- factory.go, stores.go: merged both Party + Contacts/Activity/Snapshots stores
- loop_history.go: kept upstream skill inlining constants + local session persistence
- session_store.go, sessions/manager.go, sessions_ops.go: deduplicated SetHistory()
- sidebar.tsx, routes.tsx: added Party to upstream's restructured sidebar/routes
- protocol.ts, i18n/index.ts, sidebar.json (×3): merged Party + upstream events/translations
- version.go: bumped to schema version 18

Migration collision fix: renamed 000014_party_sessions → 000018_party_sessions

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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