Skip to content

feat(skill): cron-based progress monitoring for medeo video#754

Merged
alchemistklk merged 4 commits intofeat/medeo-video-skillfrom
feat/medeo-progress-notify
Apr 1, 2026
Merged

feat(skill): cron-based progress monitoring for medeo video#754
alchemistklk merged 4 commits intofeat/medeo-video-skillfrom
feat/medeo-progress-notify

Conversation

@lefarcen
Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen commented Apr 1, 2026

What

Replace sub-agent polling with cron-based progress monitoring for video generation tasks.

Why

The sub-agent approach had reliability issues:

  • Sub-agent lost delivery context over long runs, couldn't reliably notify the user
  • Auto-announce only fires on completion, no intermediate progress updates
  • Sub-agent memory/session isolation made it forget which channel to send to

How

  • After spawn-task, the main agent sets a 2-minute cron (systemEvent) in the current session
  • Each cron tick prompts the agent to run task-status and decide whether to update the user
  • Agent uses conversation context to craft natural updates (not mechanical notifications)
  • task-status output reminds agent to cron remove when task is completed/failed
  • Removed sessions_spawn payload from spawn-task β€” no more sub-agent
  • Added MEDEO_GATEWAY_URL env var support for local mock testing

Affected areas

  • Skills

Checklist

  • No credentials or tokens in code or logs
  • Tested locally with mock server (composing β†’ rendering β†’ storing β†’ completed lifecycle)

lefarcen added 2 commits April 2, 2026 01:50
Sub-agent now sends stage-change updates to the user via message tool
(composing β†’ rendering β†’ storing) instead of silently waiting until
completion. Poll interval reduced from 3min to 1min for faster feedback.

Final video URL is returned as plain text to the main agent so it can
deliver with conversation context, keeping the interaction natural.
Replace sessions_spawn sub-agent approach with cron systemEvent:
- Main agent sets a 2-minute cron after submitting a video task
- Each cron fires a systemEvent in the same session, prompting the
  agent to check task-status and update the user conversationally
- Agent decides whether to notify based on stage change and time
  since last update β€” no mechanical notifications
- task-status output reminds agent to remove cron when task finishes
- Support MEDEO_GATEWAY_URL env var override for local testing
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 564696c94e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/static/bundled-skills/medeo-video/scripts/medeo_video.py Outdated
lefarcen added 2 commits April 2, 2026 02:59
…ivery

- GATEWAY_URL defaults to production, overridable via MEDEO_GATEWAY_URL env
- SKILL.md: agent MUST send video URL on completion, not just report status
@alchemistklk alchemistklk merged commit 5eb47e2 into feat/medeo-video-skill Apr 1, 2026
11 of 12 checks passed
lefarcen added a commit that referenced this pull request Apr 2, 2026
* feat(skill): add Medeo Video as bundled static skill

Add AI video generation skill (Seedance 2.0 via Medeo Gateway) to the
bundled skills shipped with the desktop app.

- SKILL.md with agent instructions for video generation workflow
- medeo_video.py: CLI for setup, check, upload, spawn-task, recover
- feishu_send_video.py: Feishu video delivery script
- Register "medeo-video" in STATIC_SKILL_SLUGS

* feat(skill): hardcode gateway URL, default duration 15s, max 20s, remove --gateway-url

* feat(skill): passthrough env vars to sub-agent, expand feishu credential lookup

* fix(controller): ensure new skills are visible to agent on first ask (#753)

* fix(controller): bootstrap skill ledger before first OpenClaw config push

syncAllImmediate() ran before skillhubService.start(), so the first
compiled config was missing static/bundled skills that hadn't been
copied to disk yet. OpenClaw booted with an incomplete agent skills
allowlist, and because config-reload treats agents/skills changes as
kind "none", the snapshot was never rebuilt for existing sessions.

Add SkillhubService.bootstrap() β€” runs syncNow + copyStaticSkills
before the first config push β€” so the compiled allowlist is complete
from the start.

* fix(controller): touch SKILL.md after config push to bump OpenClaw snapshot

After syncAll pushes a new config (with updated agent skills allowlist),
touch one SKILL.md in the skills directory to trigger OpenClaw's chokidar
watcher β†’ bumpSkillsSnapshotVersion. Without this, existing sessions keep
using a stale skills snapshot because OpenClaw's config-reload treats
agents/skills changes as kind "none" (no hot-reload action).

* feat(skill): cron-based progress monitoring for medeo video (#754)

* feat(skill): add progress notifications for medeo video generation

Sub-agent now sends stage-change updates to the user via message tool
(composing β†’ rendering β†’ storing) instead of silently waiting until
completion. Poll interval reduced from 3min to 1min for faster feedback.

Final video URL is returned as plain text to the main agent so it can
deliver with conversation context, keeping the interaction natural.

* feat(skill): use cron-based progress monitoring for medeo video

Replace sessions_spawn sub-agent approach with cron systemEvent:
- Main agent sets a 2-minute cron after submitting a video task
- Each cron fires a systemEvent in the same session, prompting the
  agent to check task-status and update the user conversationally
- Agent decides whether to notify based on stage change and time
  since last update β€” no mechanical notifications
- task-status output reminds agent to remove cron when task finishes
- Support MEDEO_GATEWAY_URL env var override for local testing

* fix(skill): restore production gateway URL, strengthen completion delivery

- GATEWAY_URL defaults to production, overridable via MEDEO_GATEWAY_URL env
- SKILL.md: agent MUST send video URL on completion, not just report status

* fix(skill): hardcode production gateway URL

* feat(skill): add LibTV Video as bundled static skill

- Add libtv-video to STATIC_SKILL_SLUGS (pinned as first entry)
- Seedance 2.0 as default model, auto-appended to prompts
- Supports text-to-video, image-to-video, upload, session polling
- Includes recover command for session recovery after agent restart
- All user-facing output in English with friendly status messages

---------

Co-authored-by: lefarcen <935902669@qq.com>
lefarcen added a commit that referenced this pull request Apr 2, 2026
* feat(skill): add Medeo Video as bundled static skill

Add AI video generation skill (Seedance 2.0 via Medeo Gateway) to the
bundled skills shipped with the desktop app.

- SKILL.md with agent instructions for video generation workflow
- medeo_video.py: CLI for setup, check, upload, spawn-task, recover
- feishu_send_video.py: Feishu video delivery script
- Register "medeo-video" in STATIC_SKILL_SLUGS

* feat(skill): hardcode gateway URL, default duration 15s, max 20s, remove --gateway-url

* feat(skill): passthrough env vars to sub-agent, expand feishu credential lookup

* fix(controller): ensure new skills are visible to agent on first ask (#753)

* fix(controller): bootstrap skill ledger before first OpenClaw config push

syncAllImmediate() ran before skillhubService.start(), so the first
compiled config was missing static/bundled skills that hadn't been
copied to disk yet. OpenClaw booted with an incomplete agent skills
allowlist, and because config-reload treats agents/skills changes as
kind "none", the snapshot was never rebuilt for existing sessions.

Add SkillhubService.bootstrap() β€” runs syncNow + copyStaticSkills
before the first config push β€” so the compiled allowlist is complete
from the start.

* fix(controller): touch SKILL.md after config push to bump OpenClaw snapshot

After syncAll pushes a new config (with updated agent skills allowlist),
touch one SKILL.md in the skills directory to trigger OpenClaw's chokidar
watcher β†’ bumpSkillsSnapshotVersion. Without this, existing sessions keep
using a stale skills snapshot because OpenClaw's config-reload treats
agents/skills changes as kind "none" (no hot-reload action).

* feat(skill): cron-based progress monitoring for medeo video (#754)

* feat(skill): add progress notifications for medeo video generation

Sub-agent now sends stage-change updates to the user via message tool
(composing β†’ rendering β†’ storing) instead of silently waiting until
completion. Poll interval reduced from 3min to 1min for faster feedback.

Final video URL is returned as plain text to the main agent so it can
deliver with conversation context, keeping the interaction natural.

* feat(skill): use cron-based progress monitoring for medeo video

Replace sessions_spawn sub-agent approach with cron systemEvent:
- Main agent sets a 2-minute cron after submitting a video task
- Each cron fires a systemEvent in the same session, prompting the
  agent to check task-status and update the user conversationally
- Agent decides whether to notify based on stage change and time
  since last update β€” no mechanical notifications
- task-status output reminds agent to remove cron when task finishes
- Support MEDEO_GATEWAY_URL env var override for local testing

* fix(skill): restore production gateway URL, strengthen completion delivery

- GATEWAY_URL defaults to production, overridable via MEDEO_GATEWAY_URL env
- SKILL.md: agent MUST send video URL on completion, not just report status

* fix(skill): hardcode production gateway URL

* feat(skill): add LibTV Video as bundled static skill

- Add libtv-video to STATIC_SKILL_SLUGS (pinned as first entry)
- Seedance 2.0 as default model, auto-appended to prompts
- Supports text-to-video, image-to-video, upload, session polling
- Includes recover command for session recovery after agent restart
- All user-facing output in English with friendly status messages

* fix(skill): fix NoneType crash in libtv query, add tasks command

- Fix TypeError when task_result.images/videos is null (use `or []`)
- Fix NoneType crash when gateway returns no messages
- Add `tasks` command to list all tasks for current key

* fix(skill): restrict libtv result URL to libtv-res.liblib.art/sd-gen-save-img prefix

- Update LIBTV_RES_PATTERN to only match libtv-res.liblib.art/sd-gen-save-img/
- Ignore medeo-res.liblib.art gateway proxy URLs
- Add multi-session discipline SOP and URL rules to SKILL.md
- Add tasks command to SKILL.md command reference

* fix(skill): use correct API field names in libtv tasks command

- Use `video_url` instead of hallucinated `libtv_video_url`/`medeo_video_url`/`r2_video_url`
- Default backend to `libtv` instead of `medeo`
- Add `completed_at` timestamp to output

* fix(skill): persist result_urls to local for offline recovery

- Extend _save_session to store result_urls and completed_at
- Save results locally on completion in wait-and-deliver, query-session, tasks, recover
- Recover reads completed sessions from local (no API call), only checks pending via API
- Reduces hallucination: agent can always find video URLs from local file

---------

Co-authored-by: lefarcen <935902669@qq.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.

2 participants