Commit graph

27 commits

Author SHA1 Message Date
Max
83ebe49036 refactor: unify server lifecycle, migrate gRPC client, and clean up sandbox v2
Server lifecycle:
- Introduce service.Service to manage HTTP + gRPC startup/shutdown
- Fix gRPC mutex deadlock in StartServer when port is occupied
- Add GracefulStop with 5s timeout before forced Stop in grpc.go
- Pre-check HTTP and gRPC port availability in cmd/start.go
- Print gRPC server address in startup access-points block

gRPC client refactor:
- Move token manager and client from tai/grpc/ to grpc/client/
- Add backward-compatible aliases in tai/yao.go and tai/token.go
- Update cmd/run.go to import grpc/client directly (no tai dependency)

Sandbox v2 docker migration:
- Delete sandbox/v2/docker/ (moved to tai repo)
- Update sandbox/docker/build.sh hint to point to tai repo
- Clean up .gitignore entries for removed docker directory
- Temporarily disable SandboxV2Test and BenchmarkSandboxV2 in CI
  (docker images need rebuild after tai repo migration)

Tai integration:
- Add direct-mode registration API handlers in tai/api/
- Add heartbeat handler and token management wrappers
- Update tai/registry and tai/tunnel for latest protocol
- Replace yao-grpc references with tai call in docs

Made-with: Cursor
2026-03-07 17:19:19 +08:00
Max
df63584a6f Enhance testing and configuration for Tai service
- Add TAI_TEST_HOST_IP environment variable to CI workflows for unit tests, allowing better connectivity to the gRPC server from Docker containers.
- Update the `run.go` file to parse command-line arguments correctly.
- Modify the test utility to return the gRPC address reachable from Docker, improving integration test reliability.
- Refactor integration tests to utilize the new relay address function, ensuring proper communication with the Yao gRPC server.

These changes improve the testing framework and enhance the configuration for better service interaction during CI runs.
2026-03-04 17:13:06 +08:00
Max
c6e1c449e1 Enhance Tai service readiness checks and OAuth device flow
- Improve health check logic in CI workflows for both HTTP and gRPC readiness of the Tai service, ensuring clearer error reporting if the service fails to start.
- Update the OAuth Device Flow implementation to support additional claims during device authorization, enhancing the flexibility of the authorization process.
- Refactor the `AuthorizeDevice` method to accept extra claims, allowing for more detailed user context during authorization.
- Introduce a new utility function to extract bearer tokens from requests, streamlining token handling across the OpenAPI service.

These changes enhance the robustness of service readiness checks and improve the OAuth device authorization flow, contributing to a more reliable and flexible authentication mechanism.
2026-03-04 16:55:29 +08:00
Max
d21f9c3769 Enhance Logging Functionality in RequestLogger
- Added a `noop` check in multiple logging methods (`LLMComplete`, `ToolStart`, `ToolComplete`, `HookStart`, `HookComplete`, and `HistoryLoad`) to prevent logging when the logger is in no-operation mode.
- Improved command handling in `root.go` by removing minimum argument requirements for commands and providing help output when no arguments are given.
- Introduced an `agent` command for better organization of agent-related functionalities in the CLI.
- Implemented automatic detection of the application root directory in `run.go` to streamline the application startup process.
- Cleaned up debug print statements in `config.go` to reduce clutter in the output.
2025-12-17 12:33:34 +08:00
Max
c425b74383 Refactor error handling in various components to improve logging and message formatting
- Updated error messages to use fmt.Errorf with %s for better clarity and consistency.
- Enhanced logging statements to utilize formatted strings for improved readability.
- Refactored multiple Load functions across different modules to standardize error handling practices.
2025-09-28 10:24:17 +08:00
Max
fabced291c fix: Enhance loading functions to handle non-existent directories
- Added checks in various loading functions to ignore processing if the respective directories do not exist, improving error handling and preventing unnecessary operations.
- Updated the Load function signature to return warnings alongside errors, allowing for better feedback on loading issues across different components.
2025-05-13 09:10:10 +08:00
Max
cd01149db1 Update dependencies in go.mod and go.sum; upgrade golang.org/x/crypto to v0.31.0, golang.org/x/text to v0.21.0, golang.org/x/sync to v0.10.0, and golang.org/x/sys to v0.28.0. Modify process initialization in cmd/run.go to use context for improved execution management. 2024-12-13 01:02:22 +08:00
Max
9faf8f802f chore: Update engine.Load calls with additional options 2024-05-05 17:54:32 +08:00
Max
c07b903c5c Set runtime mode and display it in start command 2023-12-28 21:17:33 +08:00
Max
7f6711f8ed [change] optimizing console output 2023-09-01 12:02:04 +08:00
Max
38150e5d66 [add] yao run command task support 2023-06-09 00:07:06 +08:00
Max
e3a60a88c5 Improve error messages 2023-05-15 18:25:23 +08:00
Max
ce4aaf667f [fix] setup & config 2023-04-24 17:38:29 +08:00
Max
527ce51c40 [add] run command silent mode 2023-04-09 13:03:38 +08:00
Max
82dfe75b2d [add] migrate run command 2023-04-01 12:18:48 +08:00
Max
a807899f95 [*] migrate to gou v0.10.3 (50%) 2023-02-01 17:25:11 +08:00
Max
94a2a6d3c4 [add] Buntdb for session store 2022-05-27 14:18:59 +08:00
Max
61a0673550 fix unit test 2022-04-10 19:16:12 +08:00
Max
657d68d477 fix load bug 2022-02-09 21:46:25 +08:00
Max
385f42c88f 规范run命令输出 2022-02-09 19:21:25 +08:00
Max
95a0d1e159 命令行工具 + 多语言支持 2022-02-09 15:45:18 +08:00
Max
34f4382c19 更新命名空间 2022-02-09 09:17:23 +08:00
Max
ea72f26d5e 调整环境变量 2022-02-09 00:49:57 +08:00
Max
e072d87a7d xiang run 支持JSON格式数据输入 :: 2022-01-08 11:47:26 +08:00
Max
c3fcfa857c 优化 Session 载入机制 2021-11-29 10:27:38 +08:00
Max
8f091b4a23 关闭时清理插件 2021-10-23 18:06:40 +08:00
Max
9076dfe7f8 v0.8.16 + run command 2021-10-23 10:29:36 +08:00