Skip to content

feat: VNPAY SDLC enhancements — Zalo, Party Mode, session cleanup#123

Open
duhd-vnpay wants to merge 5 commits intonextlevelbuilder:mainfrom
duhd-vnpay:feat/vnpay-sdlc-enhancements
Open

feat: VNPAY SDLC enhancements — Zalo, Party Mode, session cleanup#123
duhd-vnpay wants to merge 5 commits intonextlevelbuilder:mainfrom
duhd-vnpay:feat/vnpay-sdlc-enhancements

Conversation

@duhd-vnpay
Copy link

Summary

  • Zalo Bot Platform API compatibility — fix struct tags (account_name, display_name, photo_url), getUpdates 3-format parser, CDN photo download to local temp files
  • Channel credentials bytea fix — always convert to []byte before execMapUpdate
  • Party Mode engine — multi-persona collaborative discussion with Standard/Deep/Token-Ring modes, 14 personas, WebSocket RPC handlers, PostgreSQL store
  • Auto-clean orphaned tool messages — sanitizeHistory() now persists cleaned history back to session store, eliminating repeated WARN logs; added SetHistory() to SessionStore interface

Commits

  1. bdc3124 fix: Zalo Bot Platform API compatibility — struct tags, response parsing, photo handling
  2. 913f8fc feat: download Zalo CDN photos to local temp files before agent processing
  3. a95eee9 fix: always convert credentials to []byte for bytea column in channel instance updates
  4. a88536a feat: Party Mode — multi-persona collaborative discussion engine
  5. 2f26d58 fix: auto-clean orphaned tool messages from session history

Test plan

  • go build ./... compiles clean
  • go vet ./... passes
  • Existing integration tests pass
  • Zalo Bot Platform: send message → receive response (requires Zalo OA credentials)
  • Party Mode: WebSocket RPC party.startparty.roundparty.exit flow
  • Orphaned tool messages: verify WARN log appears once then stops on subsequent requests

🤖 Generated with Claude Code

duhd-vnpay and others added 5 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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
… 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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