feat: feishu interactive card approval for agent permission requests#409
Open
xinuxZ wants to merge 1 commit intoRightNow-AI:mainfrom
Open
feat: feishu interactive card approval for agent permission requests#409xinuxZ wants to merge 1 commit intoRightNow-AI:mainfrom
xinuxZ wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
When an agent requests human approval (e.g. to execute a shell command), send an interactive Feishu card with Approve/Reject buttons instead of requiring the user to type /approve <id> manually. Key changes: - Approval notification: ApprovalManager broadcasts new requests via tokio broadcast channel; bridge layer subscribes and pushes cards to the last active Feishu user in real time - Concurrent message dispatch: each inbound message now spawns its own task so a long-running agent call (blocked on approval) no longer prevents the user from sending /approve - Feishu card callback parsing: support both card.action.trigger and application.bot.menu_v6 event types; button clicks are converted to /approve or /reject commands - Feishu WebSocket receive mode: full implementation with reconnect backoff, protobuf frame decoding, ping/pong heartbeat, and multi-frame message reassembly - exec_policy smart approval: allowlisted commands skip approval (fast path); unlisted commands escalate to approval instead of hard-blocking; approved commands are persisted to config.toml - Hand agent model restore: use tag-based detection instead of hardcoded name; always re-apply default_model on DB restore - Cross-compilation fix (openfang-cli/Cargo.toml, Cross.toml): add openssl vendored feature and rustls-tls for reqwest to fix `cross build --target x86_64-unknown-linux-musl` failure — the musl Docker container lacks system OpenSSL, so vendored mode downloads and statically compiles OpenSSL from source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an agent requests human approval (e.g. to execute a shell command), send an interactive Feishu card with Approve/Reject buttons instead of requiring the user to type /approve manually.
Key changes:
Approval notification: ApprovalManager broadcasts new requests via tokio broadcast channel; bridge layer subscribes and pushes cards to the last active Feishu user in real time
Concurrent message dispatch: each inbound message now spawns its own task so a long-running agent call (blocked on approval) no longer prevents the user from sending /approve
Feishu card callback parsing: support both card.action.trigger and application.bot.menu_v6 event types; button clicks are converted to /approve or /reject commands
Feishu WebSocket receive mode: full implementation with reconnect backoff, protobuf frame decoding, ping/pong heartbeat, and multi-frame message reassembly
exec_policy smart approval: allowlisted commands skip approval (fast path); unlisted commands escalate to approval instead of hard-blocking; approved commands are persisted to config.toml
Hand agent model restore: use tag-based detection instead of hardcoded name; always re-apply default_model on DB restore
Cross-compilation fix (openfang-cli/Cargo.toml, Cross.toml): add openssl vendored feature and rustls-tls for reqwest to fix
cross build --target x86_64-unknown-linux-muslfailure — the musl Docker container lacks system OpenSSL, so vendored mode downloads and statically compiles OpenSSL from sourceSummary
Changes
Testing
cargo clippy --workspace --all-targets -- -D warningspassescargo test --workspacepassesSecurity