mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
* Update CLAUDE.md to clarify pull request workflow and enhance documentation - Added a note to emphasize the importance of opening pull requests against the upstream repository instead of a fork's default remote, ensuring better collaboration and code management. - Improved the overall clarity of the Git workflow section, contributing to a more streamlined development process. * Refactor REPL session handling and remove deprecated chat methods - Removed the `repl_session_chat` functionality from the schema and related files, streamlining the REPL session management. - Introduced a new `start_chat` method in the web channel provider for handling chat interactions, enhancing the chat system's architecture. - Updated socket handling to improve event emission with alias support, ensuring better communication across the application. - Enhanced error handling and logging for chat operations, providing clearer feedback during interactions. - Consolidated chat-related logic into the new web channel module, improving maintainability and organization. * Refactor apiClient to improve token management and eliminate circular dependencies - Renamed `_getToken` to `authTokenGetterRef` for clarity and to avoid clashing with transpiled private method names. - Updated the `setStoreForApiClient` function to use the new `authTokenGetterRef` variable, ensuring the `apiClient` remains free of direct imports from `store/index`. - Enhanced the `ApiClient` class by renaming the `getToken` method to `resolveAuthToken`, improving readability and consistency in token retrieval logic. - Adjusted comments in `apiClient.ts` and `store/index.ts` to reflect the changes and clarify the purpose of the lazy store accessor. * Enhance API client integration with store for improved token management - Introduced `setStoreForApiClient` in `main.tsx` to bind the Redux store's auth token for API requests, ensuring seamless token access. - Updated comments in `apiClient.ts` to clarify the lazy token accessor's purpose and prevent circular dependencies. - Removed the previous direct call to `setStoreForApiClient` from `store/index.ts`, centralizing the setup in `main.tsx` for better organization. - Enhanced test setup to include the new store binding, ensuring consistent token retrieval during testing. * Refactor web channel event handling and enhance chat functionality - Updated `WebChatSseEvent` structure to include new fields: `tool_name`, `skill_id`, `args`, `output`, `success`, and `round`, improving the granularity of event data. - Refactored event emission logic in `emit_web_chat_event` to utilize the new fields, ensuring more informative payloads for tool calls and results. - Enhanced the `start_chat` and `cancel_chat` functions to accommodate the new event structure, improving chat session management. - Introduced a new function `publish_tool_events_from_history` to streamline the emission of tool call and result events from chat history, enhancing the overall chat experience. * Refactor web channel integration and enhance controller management - Updated references from the deprecated `web_channel` module to the new `channels::providers::web` structure, improving code organization and maintainability. - Refactored the `build_registered_controllers` and `build_declared_controller_schemas` functions to utilize the new web channel controller methods, ensuring consistency across the application. - Removed the obsolete `web_channel` module and its associated files, streamlining the codebase and enhancing clarity in the channel management system. - Introduced new functions for managing web channel events and schemas, improving the overall architecture of the web channel integration. * Refactor main.tsx and test setup for improved organization - Reordered imports in `main.tsx` to enhance clarity and maintainability, ensuring that `setStoreForApiClient` is called with the correct store reference. - Removed unnecessary whitespace in `setup.ts`, streamlining the test setup file for better readability. * Fix service gate false blocking when service is running * Support soft-pass daemon gate and harden macOS service detection * Extend list-files fallback trigger phrases in agent loop * Replace list-files fallback with tool-call repair retry * Log full system prompt and drop tool-call repair flow * Add tracing-log dependency and enhance CLI logging - Introduced `tracing-log` as a dependency to bridge `log` and `tracing` for improved logging capabilities. - Added a `--verbose` flag to the CLI for enhanced logging detail, initializing the logging level based on this flag. - Implemented an HTTP request logging middleware to capture and log request details. - Updated CLI help output to reflect the new `--verbose` option and improved logging messages throughout the application. * Tighten system prompt for native tool-calling * Auto-create missing workspace context markdown files * Seed workspace prompt files from canonical agent prompt templates * Enhance logging with nu-ansi-term and improve CLI output - Added `nu-ansi-term` dependency for colored terminal output in logs. - Implemented a custom logging format for better readability in CLI. - Updated logging initialization to conditionally use ANSI colors based on terminal support. - Added debug logging for agent responses to aid in troubleshooting. * Harden OpenAI-compatible native tool-call parsing * Format provider tool-call parsing updates * Implement inline autocomplete suggestions in Conversations component - Added functionality for inline suggestions based on user input in the Conversations component. - Introduced debounce logic for autocomplete requests to optimize performance. - Enhanced user experience by allowing suggestions to be accepted via the Tab key. - Updated UI to display inline completion suffixes in the input area. - Modified backend to support new autocomplete features and improved error handling. * Add macOS ARM64 build workflow and enhance release process - Introduced a new GitHub Actions workflow for building signed macOS ARM64 bundles. - Updated the release workflow to validate signing prerequisites for macOS builds. - Enhanced the Tauri configuration preparation to include updater settings. - Added necessary secrets to the example secrets file for macOS signing. - Implemented CLI autocomplete functionality for macOS, including options for debounce and process management.
201 lines
5.3 KiB
Bash
Executable File
201 lines
5.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Test the Release workflow locally using act.
|
|
#
|
|
# Defaults are safe:
|
|
# - Uses scripts/ci-secrets.example.json for secrets/vars.
|
|
# - Runs in dry-run mode unless --run is passed.
|
|
#
|
|
# For --run: set GitHub App credentials in scripts/ci-secrets.json:
|
|
# - XGITHUB_APP_ID
|
|
# - XGITHUB_APP_PRIVATE_KEY
|
|
# prepare-release uses those to mint a token for checkout/push.
|
|
# Do not put a bad GITHUB_TOKEN in ci-secrets.json — act uses it to clone action repos and an
|
|
# invalid PAT breaks even public clones.
|
|
#
|
|
# Usage:
|
|
# ./scripts/test-release-act.sh
|
|
# ./scripts/test-release-act.sh --run
|
|
# ./scripts/test-release-act.sh --list
|
|
# ./scripts/test-release-act.sh --job prepare-release
|
|
# ./scripts/test-release-act.sh --release-type minor
|
|
# ./scripts/test-release-act.sh --secrets-json scripts/ci-secrets.json --run
|
|
# # Single macOS (Apple Silicon) build for signing — pass through to act --matrix:
|
|
# ./scripts/test-release-act.sh --run --job build-artifacts \
|
|
# --matrix 'settings.platform:macos-latest' --matrix 'settings.args:--target aarch64-apple-darwin'
|
|
|
|
set -euo pipefail
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
WORKFLOW=".github/workflows/release.yml"
|
|
SECRETS_JSON="scripts/ci-secrets.json"
|
|
RELEASE_TYPE="patch"
|
|
RUN_MODE="dryrun"
|
|
JOB_NAME=""
|
|
MATRIX_ARGS=()
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--run)
|
|
RUN_MODE="run"
|
|
shift
|
|
;;
|
|
--dryrun)
|
|
RUN_MODE="dryrun"
|
|
shift
|
|
;;
|
|
--list)
|
|
RUN_MODE="list"
|
|
shift
|
|
;;
|
|
--job)
|
|
JOB_NAME="${2:-}"
|
|
shift 2
|
|
;;
|
|
--release-type)
|
|
RELEASE_TYPE="${2:-patch}"
|
|
shift 2
|
|
;;
|
|
--secrets-json)
|
|
SECRETS_JSON="${2:-}"
|
|
shift 2
|
|
;;
|
|
--matrix)
|
|
MATRIX_ARGS+=(--matrix "${2:-}")
|
|
shift 2
|
|
;;
|
|
*)
|
|
echo "Unknown argument: $1" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ ! -f "$SECRETS_JSON" ]]; then
|
|
echo "Secrets JSON not found: $SECRETS_JSON" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v act >/dev/null 2>&1; then
|
|
echo "act is required. Install with: brew install act" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v jq >/dev/null 2>&1; then
|
|
echo "jq is required. Install with: brew install jq" >&2
|
|
exit 1
|
|
fi
|
|
|
|
case "$RELEASE_TYPE" in
|
|
major|minor|patch) ;;
|
|
*)
|
|
echo "--release-type must be one of: major, minor, patch" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
if [[ "$RUN_MODE" == "list" ]]; then
|
|
act -W "$WORKFLOW" --list
|
|
exit 0
|
|
fi
|
|
|
|
SECRETS_FILE="$(mktemp)"
|
|
VARS_FILE="$(mktemp)"
|
|
EVENT_JSON="$(mktemp)"
|
|
MERGED_SECRETS="$(mktemp)"
|
|
trap 'rm -f "$SECRETS_FILE" "$VARS_FILE" "$EVENT_JSON" "$MERGED_SECRETS"' EXIT
|
|
|
|
# Merge defaults: APPLE_APP_SPECIFIC_PASSWORD (APPLE_PASSWORD is a common alias).
|
|
# Do not put GITHUB_TOKEN in the act secret file — an invalid PAT breaks act's clone of public actions.
|
|
jq '
|
|
.secrets |= (
|
|
. + {
|
|
APPLE_APP_SPECIFIC_PASSWORD: (
|
|
if (.APPLE_APP_SPECIFIC_PASSWORD // "") | length > 0 then .APPLE_APP_SPECIFIC_PASSWORD
|
|
else (.APPLE_PASSWORD // "") end
|
|
)
|
|
}
|
|
)
|
|
' "$SECRETS_JSON" > "$MERGED_SECRETS"
|
|
|
|
# act --secret-file/--var-file expect dotenv format. Unquoted multiline values break the
|
|
# parser (PEM/private keys look like extra KEY= lines and trigger errors on '/' etc.).
|
|
jq -r '
|
|
def dotenv_escape:
|
|
gsub("\""; "\\\"") | gsub("\r"; "\\r") | gsub("\n"; "\\n");
|
|
(.secrets // {}) | to_entries[] | select(.key != "GITHUB_TOKEN") | "\(.key)=\"\(.value | dotenv_escape)\""
|
|
' "$MERGED_SECRETS" > "$SECRETS_FILE"
|
|
jq -r '
|
|
def dotenv_escape:
|
|
gsub("\""; "\\\"") | gsub("\r"; "\\r") | gsub("\n"; "\\n");
|
|
(.vars // {}) | to_entries[] | "\(.key)=\"\(.value | dotenv_escape)\""
|
|
' "$SECRETS_JSON" > "$VARS_FILE"
|
|
|
|
# Use real owner/repo from git so context.repo and tauri-action match your fork (not local/openhuman).
|
|
REPO_FULL="${GITHUB_REPOSITORY:-}"
|
|
if [[ -z "$REPO_FULL" ]]; then
|
|
REPO_FULL="$(git remote get-url origin 2>/dev/null | sed -E 's#^git@github\.com:([^/]+)/([^/.]+)(\.git)?$#\1/\2#; s#^https://github\.com/([^/]+)/([^/.]+)(\.git)?$#\1/\2#')"
|
|
fi
|
|
if [[ -z "$REPO_FULL" || "$REPO_FULL" != */* ]]; then
|
|
echo "Could not resolve GitHub owner/repo (set GITHUB_REPOSITORY or fix git remote origin)" >&2
|
|
exit 1
|
|
fi
|
|
OWNER="${REPO_FULL%%/*}"
|
|
REPO_NAME="${REPO_FULL##*/}"
|
|
|
|
jq -n \
|
|
--arg ref "refs/heads/main" \
|
|
--arg rt "$RELEASE_TYPE" \
|
|
--arg full "$REPO_FULL" \
|
|
--arg owner "$OWNER" \
|
|
--arg name "$REPO_NAME" \
|
|
'{
|
|
ref: $ref,
|
|
inputs: { release_type: $rt },
|
|
repository: {
|
|
full_name: $full,
|
|
default_branch: "main",
|
|
name: $name,
|
|
owner: { login: $owner }
|
|
},
|
|
sender: { login: "local-dev" }
|
|
}' > "$EVENT_JSON"
|
|
|
|
echo "Workflow: $WORKFLOW"
|
|
echo "Secrets: $SECRETS_JSON"
|
|
echo "Input: release_type=$RELEASE_TYPE"
|
|
echo "Mode: $RUN_MODE"
|
|
if [[ -n "$JOB_NAME" ]]; then
|
|
echo "Job: $JOB_NAME"
|
|
fi
|
|
if [[ ${#MATRIX_ARGS[@]} -gt 0 ]]; then
|
|
echo "Matrix: ${MATRIX_ARGS[*]}"
|
|
fi
|
|
echo
|
|
|
|
ACT_ARGS=(
|
|
workflow_dispatch
|
|
-W "$WORKFLOW"
|
|
--eventpath "$EVENT_JSON"
|
|
--secret-file "$SECRETS_FILE"
|
|
--var-file "$VARS_FILE"
|
|
--container-architecture linux/amd64
|
|
-P ubuntu-latest=catthehacker/ubuntu:act-latest
|
|
-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
|
|
-P macos-latest=-self-hosted
|
|
)
|
|
|
|
if [[ -n "$JOB_NAME" ]]; then
|
|
ACT_ARGS+=(-j "$JOB_NAME")
|
|
fi
|
|
|
|
if [[ ${#MATRIX_ARGS[@]} -gt 0 ]]; then
|
|
ACT_ARGS+=("${MATRIX_ARGS[@]}")
|
|
fi
|
|
|
|
if [[ "$RUN_MODE" == "dryrun" ]]; then
|
|
echo "Dry-run only. Use --run to execute."
|
|
act "${ACT_ARGS[@]}" -n
|
|
else
|
|
act "${ACT_ARGS[@]}"
|
|
fi
|