Integrate Feishu reply TTS features and refine streaming UI sections#77
Open
lusile2024 wants to merge 36 commits into
Open
Integrate Feishu reply TTS features and refine streaming UI sections#77lusile2024 wants to merge 36 commits into
lusile2024 wants to merge 36 commits into
Conversation
Reply TTS now uses the local Sherpa Kokoro service path, can start the localhost service from explicit TTS demand paths, and treats bare source filenames as files during speech normalization so .cs file names are not read as methods. External CLI history now carries source metadata through the service layer so Feishu history replies can show native thread and source-path context without forcing UI pages to rebuild that text. Constraint: Repository-local .codex state must stay ignored and untracked Constraint: Reply TTS depends on a same-host localhost service and must preserve text/card replies when audio startup is unavailable Rejected: Start TTS from passive health checks | health endpoints should observe state without hidden process side effects Rejected: Commit appsettings.Development.json local paths | machine-local settings should remain outside the commit Confidence: high Scope-risk: moderate Directive: Keep auto-start limited to explicit reply TTS demand paths unless product requirements change Tested: dotnet test WebCodeCli.Domain.Tests\WebCodeCli.Domain.Tests.csproj --no-restore --filter FullyQualifiedName~ReplyTtsSpeechTextNormalizerTests|FullyQualifiedName~FeishuReplyTtsPlatformServiceTests|FullyQualifiedName~ReplyTtsStartupHostedServiceTests|FullyQualifiedName~ExternalCliHistoryTextBuilderTests|FullyQualifiedName~ExternalCliSessionHistoryServiceTests Tested: dotnet test tests\WebCodeCli.Tests\WebCodeCli.Tests.csproj --no-restore --filter FullyQualifiedName~AdminControllerReplyTtsTests Tested: dotnet build WebCodeCli.sln --no-restore Tested: dotnet test WebCodeCli.Domain.Tests\WebCodeCli.Domain.Tests.csproj --no-restore --filter FullyQualifiedName~ReplyTts|FullyQualifiedName~SherpaKokoroTtsClientTests|FullyQualifiedName~AudioTranscodeServiceTests|FullyQualifiedName~ReplyTtsChunkerTests|FullyQualifiedName~ReplyTtsOrchestratorTests|FullyQualifiedName~ReplyTtsStorageRootResolverTests|FullyQualifiedName~FeishuCardActionServiceTests Tested: python -m pytest tools\sherpa-kokoro-service\tests Not-tested: End-to-end Feishu audio delivery after an application restart
The requested change is a styling-only refinement, so the spec narrows scope to the in-flight streaming reply card and keeps completed-message cards, workflow behavior, and session settings out of scope. The design records the approved direction: preserve the current card behavior, split the streaming surface into clear content/status/workflow sections, and use red horizontal dividers plus spacing to make the boundaries obvious on desktop and mobile. Constraint: Must not change streaming behavior, button wiring, or prompt routing Rejected: Redesign completed assistant cards too | expands the diff beyond the approved scope Rejected: Add collapsible control sections | introduces new interaction instead of pure visual separation Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep implementation local to the streaming reply surfaces unless a later design explicitly broadens scope Tested: Reviewed spec against current desktop and mobile streaming UI files Not-tested: Runtime visual verification in browser
The approved design intentionally keeps this change narrow: only the in-flight streaming reply surfaces should gain stronger section boundaries, and behavior must remain unchanged. The plan documents the exact Razor files, the section wrapper strategy, the build/test commands, and the manual checks needed because this repository does not currently have a dedicated component-test harness for these streaming UI surfaces. Constraint: Must keep the change local to Razor markup and utility classes without adding new dependencies Rejected: Add a new component-testing stack first | too large for a focused styling task Rejected: Expand the plan to completed assistant cards | not part of the approved scope Confidence: high Scope-risk: narrow Reversibility: clean Directive: Preserve all streaming callbacks and prompt-routing behavior when implementing the markup changes Tested: Reviewed plan against current desktop and mobile streaming markup Not-tested: Browser execution of the planned UI flow
Adds Goal capability probing + prompt building, wires Goal quick input submission into the UI, and extends Feishu card rendering to separate sections more clearly while preserving existing actions. Constraint: Feishu CardKit streaming cards cannot rely on CSS or custom divider colors, so section separation is done via content modules Rejected: Introduce new UI-only goal entry point | must work through Feishu cards and existing quick input patterns Confidence: medium Scope-risk: moderate Directive: Keep card action payloads stable; update JSON-shape tests whenever card module ordering changes Tested: dotnet test WebCodeCli.sln -c Release Not-tested: Manual end-to-end Feishu bot interaction
The public installer previously shipped only the WebCode app payload, which left the Feishu reply TTS wrapper outside the release even though runtime auto-start expects it under the app tree. This change bumps the app version to 0.2.8, copies the Kokoro/sherpa-onnx wrapper assets into publish output, and makes the bundled README valid for both repo and installed layouts. Constraint: Existing GitHub release v0.2.7 already exists, so a new release needs a distinct application version Constraint: Reply TTS still depends on external Python packages, models, ffmpeg, and non-system-drive storage Rejected: Bundle Python venv and model payloads into the installer | package size and machine-specific runtime setup are too variable Confidence: high Scope-risk: moderate Directive: Keep the reply TTS wrapper under tools/sherpa-kokoro-service inside publish output so auto-start path discovery continues to work Tested: dotnet test WebCodeCli.sln -c Release Tested: powershell -NoProfile -ExecutionPolicy Bypass -File .\tools\build-windows-installer.ps1 Not-tested: GitHub push and Release asset upload
Merge feature/low-interruption-native-continue after verifying the feature branch test suite. This brings the remaining Feishu reply TTS pipeline, local MeloTTS wrapper, audio send flow, streaming card refinements, and Windows release packaging updates onto main. Constraint: Keep the already-merged quick-action and low-interruption work on origin/main intact while integrating the remaining branch history Rejected: Cherry-pick only packaging commits | user requested merging the branch into main Confidence: medium Scope-risk: broad Reversibility: clean Directive: Treat feature/low-interruption-native-continue as fully integrated into main after this merge and audit follow-up fixes against main first Tested: dotnet test WebCodeCli.sln -c Release on feature branch before merge Not-tested: merged-main test run pending
ReplyTtsSpeechTextNormalizer intentionally returns LF-separated text, but the raw-string assertion depended on the test file's checkout line endings after the merge. Normalize the expected literal before comparison so the test verifies behavior instead of platform-specific source formatting. Constraint: ReplyTtsSpeechTextNormalizer normalizes output to LF by design Rejected: Change the normalizer to Environment.NewLine | would make speech text formatting host-dependent Confidence: high Scope-risk: narrow Reversibility: clean Directive: Normalize expected line endings in multiline assertions whenever the implementation intentionally canonicalizes output Tested: dotnet test WebCodeCli.Domain.Tests/WebCodeCli.Domain.Tests.csproj -c Release --filter FullyQualifiedName~ReplyTtsSpeechTextNormalizerTests.Normalize_RemovesMarkdownLinksAndCodeBlocks Tested: dotnet test WebCodeCli.sln -c Release -m:1 --disable-build-servers Not-tested: default multi-node MSBuild run without build-server reset
This change fixes two packaging-adjacent runtime regressions and captures the local Windows installer workflow as a reusable skill. Feishu quick actions now fall back to card inputValues when formValue is missing, which restores Superpowers and Goal prompt submission in cards that do not round-trip the form payload. Packaged SQLite paths now resolve against AppContext.BaseDirectory and create parent folders automatically, so installer and portable launches no longer fail on first start when using relative data paths. The Windows installer scripts and Inno Setup definition are updated for the bundled Reply TTS payload, and the repo now includes a Codex skill wrapper that delegates local installer builds to the single source of truth packaging script. Constraint: Packaged Windows launches use relative SQLite paths and a bundled non-system-drive Reply TTS payload Rejected: Require users to create the data directory manually | fragile first-run experience Rejected: Duplicate packaging logic inside the skill | would drift from tools/build-windows-installer.ps1 Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep packaged SQLite paths anchored to AppContext.BaseDirectory and keep installer behavior centralized in tools/build-windows-installer.ps1 Tested: python skills/codex/skill-creator/scripts/quick_validate.py skills/codex/webcode-local-windows-tts-installer Tested: dotnet test tests/WebCodeCli.Tests/WebCodeCli.Tests.csproj --filter SqliteConnectionStringResolverTests Tested: dotnet test WebCodeCli.Domain.Tests/WebCodeCli.Domain.Tests.csproj --filter HandleCardActionAsync_SubmitSuperpowersQuickInput_UsesInputValuesWhenFormValueIsMissing|HandleCardActionAsync_SubmitGoalQuickInput_UsesInputValuesWhenFormValueIsMissing Tested: powershell -NoProfile -ExecutionPolicy Bypass -File skills/codex/webcode-local-windows-tts-installer/scripts/build-local-installer.ps1 -RepoRoot D:\VSWorkshop\WebCode -Configuration Debug -OutputRoot artifacts\windows-installer-sqlite-fix-check Not-tested: Clean-machine interactive install of the rebuilt Windows installer
Session-local Codex provider sync already rewrote matching rollout metadata in place, which made it impossible to recover the pre-sync thread view when a rollout needed to be inspected or restored. This change writes a session-local backup under .codex/rollout-backups before any rollout rewrite proceeds, and treats backup failures as a skip so we never overwrite without a recovery copy. Constraint: Backups must stay outside sessions/archived_sessions so Codex rollout discovery never mistakes them for live history Rejected: Side-by-side .bak files in the rollout directories | Pollutes Codex scan roots and makes future matching less predictable Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep rollout backups session-local and outside live Codex scan roots unless rollout discovery is updated to explicitly exclude new locations Tested: dotnet test WebCodeCli.sln -c Release Not-tested: Local Windows installer packaging after this commit
WebCode was probing Codex goals support by starting the configured command directly, which breaks on Windows installs that resolve through codex.cmd or codex.ps1. The probe now resolves PATH wrappers before execution, and README now documents goal support, Superpowers workflow entry points, Feishu capabilities, and the Windows packaging path for TTS-enabled installers. Constraint: Codex on Windows may be installed behind cmd or PowerShell launcher wrappers Constraint: README should surface shipped workflow features rather than leaving them buried in code and plan docs Rejected: Require users to replace Command with an absolute .exe path | fragile across npm/global install layouts Rejected: Leave README as deployment-only overview | hides shipped goal, Superpowers, and Feishu workflow capabilities Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep capability probes using the same launcher semantics as real session startup on Windows Tested: dotnet test tests/WebCodeCli.Tests/WebCodeCli.Tests.csproj --filter FullyQualifiedName~GoalCapabilityServiceTests Not-tested: End-to-end /goal trigger through the running Web UI or Feishu card callback path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Feishu streaming responses previously replaced the whole card body with an error message when a CLI run failed, which discarded already streamed content. The channel and card-action flows now append a bold error block after the last rendered content so users keep the useful partial output and still see the failure state clearly. Constraint: Feishu streaming cards must preserve already delivered content when failures happen late in the run Constraint: Error state still needs to remain obvious in compact card rendering Rejected: Replace the full card body on error | destroys valid streamed output that users may still need Rejected: Hide the error in status text only | too easy to miss in a long streaming response Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep final error rendering additive unless a future card design explicitly requires full replacement Tested: dotnet test tests/WebCodeCli.Tests/WebCodeCli.Tests.csproj --filter FullyQualifiedName~FeishuStreamingErrorFormatterTests Not-tested: End-to-end Feishu bot callback rendering against a live card session Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The repository now carries two repo-specific skill bundles so repeated Windows packaging and release work can reuse the same scripted flow instead of ad hoc terminal commands. One bundle targets local TTS-enabled installer builds, and the other targets the full GitHub release asset publishing path. Constraint: These workflows are repo-specific and depend on the current WebCode layout, asset names, and packaging scripts Constraint: Skill bundles are currently distributed as packaged .skill archives rather than unpacked source directories Rejected: Recreate these workflows manually for each release | too error-prone for packaging and asset sync steps Rejected: Unpack and rearrange the skill archives in this commit | unnecessary structure change without a repo convention change Confidence: medium Scope-risk: narrow Reversibility: clean Directive: If the team later standardizes unpacked skill sources in-repo, migrate both bundles together instead of mixing formats Tested: Opened each .skill archive and verified SKILL.md plus script payload are present Not-tested: Installing these .skill archives through a skill loader in a fresh environment Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.