Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
aad694a
feat: enforce optional model capability admission
bread-lxy Nov 9, 2026
c4faa7b
fix: validate capability inputs within shared query deadline
bread-lxy Nov 9, 2026
ac86ac5
feat: present model capabilities across configuration and creation
bread-lxy Nov 9, 2026
e6c1121
test: preserve accepted work across capability changes
bread-lxy Nov 9, 2026
88dc12e
fix(ui): clarify capability states and input requirements
bread-lxy Nov 10, 2026
235859c
fix(capabilities): validate serialized inputs without dropping images
bread-lxy Nov 10, 2026
58e79f5
feat(tools): preserve region edits with declared native masks
bread-lxy Nov 10, 2026
e2f2cf7
docs(test): document capability acceptance and portable audio cases
bread-lxy Nov 10, 2026
d948492
test(canvas): select a new region when continuing tool output
bread-lxy Nov 10, 2026
fadcf8a
fix: validate and freeze image tool request parameters
bread-lxy Nov 10, 2026
6afc56e
[bugfix] providers: match capabilities to transmitted requests
bread-lxy Nov 10, 2026
7504bb2
[bugfix] providers: reject disabled endpoints for unknown profiles
bread-lxy Nov 10, 2026
4732cbf
[bugfix] providers: apply endpoint closure across incomplete profiles
bread-lxy Nov 10, 2026
d3ec162
fix(ui): show shared capability sources once
bread-lxy Nov 10, 2026
3ddd53b
test(providers): isolate capability checks and await page renewals
bread-lxy Nov 10, 2026
327c35f
fix(tools): preserve missing model guidance in both languages
bread-lxy Nov 10, 2026
d6c98ad
fix(canvas): notify each task failure once across recovery
bread-lxy Nov 10, 2026
b28515e
fix: clarify busy service and blocked result download errors
bread-lxy Nov 10, 2026
faf43d1
fix: refresh generation history when the language changes
bread-lxy Nov 10, 2026
7f0f6df
Merge upstream main and preserve image capability checks
bread-lxy Nov 10, 2026
f2ddd22
docs: illustrate bilingual model capability cards
bread-lxy Nov 10, 2026
953ffb9
Merge upstream MiniMax image support
bread-lxy Nov 10, 2026
5e691a5
fix: check MiniMax image requests against transmitted parameters
bread-lxy Nov 10, 2026
a0fbd18
Merge remote-tracking branch 'upstream/main' into codex/final-validat…
bread-lxy Nov 10, 2026
b0b2087
Merge upstream main for review follow-up
bread-lxy Nov 11, 2026
1501c87
fix: validate the music seed frozen for execution
bread-lxy Nov 11, 2026
745222c
fix: expire capability evidence from its source timestamp
bread-lxy Nov 11, 2026
501322c
fix: describe video request roles and share parameter preparation
bread-lxy Nov 11, 2026
a924e80
fix: validate video input purposes on the selected route
bread-lxy Nov 11, 2026
1707827
test: verify video capability admission and preserved user inputs
bread-lxy Nov 11, 2026
7dfe8c1
Merge upstream main and preserve capability admission
bread-lxy Nov 13, 2026
54b42a0
fix: keep latent continuation separate from video uploads
bread-lxy Nov 13, 2026
d01109f
fix: enforce exact endpoint closures without model declarations
bread-lxy Nov 13, 2026
2947567
test: verify video review regressions through HTTP and browser flows
bread-lxy Nov 13, 2026
4fc1e25
fix: exclude latent continuation from service upload counts
bread-lxy Nov 13, 2026
4ecd06e
fix: check assistant gateway token limits before acceptance
bread-lxy Nov 13, 2026
769b5bb
fix: select image capability checks by transmitted count
bread-lxy Nov 13, 2026
8749150
Merge upstream main through b375cc3 into capability discovery
bread-lxy Nov 14, 2026
8d21526
fix: include pinned references in capability selection
bread-lxy Nov 14, 2026
ef1c0c7
fix: isolate HTTP browser fixtures in nightly checks
bread-lxy Nov 16, 2026
a092141
Merge upstream main through c2ced6c into capability discovery
bread-lxy Nov 16, 2026
15c163e
refactor: share capability candidates and tool input roles
bread-lxy Nov 16, 2026
236ee53
fix: explain minimum input counts and cover request admission
bread-lxy Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ jobs:
mkdir -p "$RUNNER_TEMP/extended-logs"
fixture_api_pid=""
fixture_web_pid=""
http_fixture_api_pid=""
http_fixture_web_pid=""
python tests/browser/creation_server.py --port 8019 >"$RUNNER_TEMP/creation-server.log" 2>&1 &
api_pid=$!
OPENDIRECTOR_API_URL="$CREATION_API_URL" npm run dev -- --port 5179 --strictPort >"$RUNNER_TEMP/vite.log" 2>&1 &
web_pid=$!
trap 'kill "$api_pid" "$web_pid" "$fixture_api_pid" "$fixture_web_pid" 2>/dev/null || true; wait 2>/dev/null || true' EXIT
trap 'kill "$api_pid" "$web_pid" "$fixture_api_pid" "$fixture_web_pid" "$http_fixture_api_pid" "$http_fixture_web_pid" 2>/dev/null || true; wait 2>/dev/null || true' EXIT
for attempt in {1..60}; do
if curl --silent --fail -H 'X-OpenDirector-Request: 1' "$CREATION_API_URL/api/creation-test-health" >/dev/null && curl --silent --fail "$CREATION_WEB_URL/" >/dev/null; then
break
Expand Down Expand Up @@ -212,6 +214,7 @@ jobs:
done
curl --fail -H 'X-OpenDirector-Request: 1' http://127.0.0.1:8020/api/creation-test-health
curl --silent --fail http://127.0.0.1:5180/ >/dev/null
CREATION_WEB_URL=http://127.0.0.1:5180 CREATION_API_URL=http://127.0.0.1:8020 node scripts/check-browser-manifest.mjs --lane extendedFixture
fixture_scripts=()
while IFS= read -r line; do fixture_scripts+=("$line"); done < <(
node -e 'const m=require("./tests/browser/manifest.json");for(const s of m.scripts)if((s.lanes||[]).includes("extendedFixture"))console.log([s.file,...(s.args||[])].join(" "))'
Expand All @@ -227,9 +230,35 @@ jobs:
failed=1
fi
done
# These workflows exercise real HTTP adapters, so they cannot share
# the generic provider used by the existing fixture workflows.
python tests/browser/creation_server.py --port 8021 --http-generation-fixture --assistant-fixture >"$RUNNER_TEMP/http-creation-server.log" 2>&1 &
http_fixture_api_pid=$!
OPENDIRECTOR_API_URL=http://127.0.0.1:8021 npm run dev -- --port 5181 --strictPort >"$RUNNER_TEMP/http-vite.log" 2>&1 &
http_fixture_web_pid=$!
for attempt in {1..60}; do
if curl --silent --fail -H 'X-OpenDirector-Request: 1' http://127.0.0.1:8021/api/creation-test-health >/dev/null && curl --silent --fail http://127.0.0.1:5181/ >/dev/null; then
break
fi
sleep 1
done
CREATION_WEB_URL=http://127.0.0.1:5181 CREATION_API_URL=http://127.0.0.1:8021 node scripts/check-browser-manifest.mjs --lane extendedHttpFixture
http_fixture_scripts=()
while IFS= read -r line; do http_fixture_scripts+=("$line"); done < <(
node -e 'const m=require("./tests/browser/manifest.json");for(const s of m.scripts)if((s.lanes||[]).includes("extendedHttpFixture"))console.log([s.file,...(s.args||[])].join(" "))'
)
for entry in "${http_fixture_scripts[@]}"; do
log="$RUNNER_TEMP/extended-logs/${entry%.mjs}.log"
if CREATION_WEB_URL=http://127.0.0.1:5181 CREATION_API_URL=http://127.0.0.1:8021 node "tests/browser/$entry" >"$log" 2>&1; then
echo "pass $entry" >> extended-results.txt
else
echo "fail $entry" >> extended-results.txt
failed=1
fi
done
cat extended-results.txt
if [ "$failed" -ne 0 ]; then
for entry in "${scripts[@]}" "${fixture_scripts[@]}"; do
for entry in "${scripts[@]}" "${fixture_scripts[@]}" "${http_fixture_scripts[@]}"; do
log="$RUNNER_TEMP/extended-logs/${entry%.mjs}.log"
if grep -Fq "fail $entry" extended-results.txt; then
echo "===== $entry ====="
Expand All @@ -241,7 +270,7 @@ jobs:
- name: Print isolated service logs on failure
if: failure()
run: |
for log in "$RUNNER_TEMP/creation-server.log" "$RUNNER_TEMP/vite.log" "$RUNNER_TEMP/assistant-creation-server.log" "$RUNNER_TEMP/assistant-vite.log"; do
for log in "$RUNNER_TEMP/creation-server.log" "$RUNNER_TEMP/vite.log" "$RUNNER_TEMP/assistant-creation-server.log" "$RUNNER_TEMP/assistant-vite.log" "$RUNNER_TEMP/http-creation-server.log" "$RUNNER_TEMP/http-vite.log"; do
if [ -f "$log" ]; then tail -n 150 "$log"; fi
done
- name: Upload extended lane results
Expand Down
26 changes: 24 additions & 2 deletions apps/api/src/opendirector_api/agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Project-scoped assistant persistence and native runtime streaming."""
import asyncio
from contextlib import aclosing, suppress
from dataclasses import replace
import json
import logging
from pathlib import Path
Expand All @@ -18,9 +19,11 @@
from opendirector.agent.runtime import AgentRuntimes, runtime_available, configured_runtimes, runtime_spec, runtime_catalog, runtime_status
from opendirector.agent.skills import skills
from opendirector.domain.projects import ProjectError
from opendirector.application.model_availability import requests_for
from opendirector.domain.rule_facts import MAX_REFERENCES, PROMPT_MAX_LENGTH
from opendirector.infrastructure.creation_projects import durable_json
from opendirector.infrastructure.local_projects import child, read_json
from opendirector.integrations.chat_completions import CHAT_MAX_TOKENS
from opendirector_api.localization import localized_error_for_language

logger = logging.getLogger(__name__)
Expand All @@ -29,6 +32,12 @@
Runtime = RuntimeId


def _assistant_request(config):
"""Admission uses the same output ceiling as the configured model gateway."""
return replace(requests_for(config, inputs={'text'})[0],
parameters=(('max_tokens', CHAT_MAX_TOKENS),))


class Draft(BaseModel):
conversationId: UUID | None = None
model_config = ConfigDict(extra='forbid')
Expand Down Expand Up @@ -113,7 +122,8 @@ def path(self, project_id: UUID, session: str | None = None) -> Path:
return directory

def update(self, project_id: UUID, session: str | None = None, *, draft: Draft | None = None,
begin: dict | None = None, finish: dict | None = None, conversation_id: UUID | None = None) -> dict:
begin: dict | None = None, finish: dict | None = None, conversation_id: UUID | None = None,
before_begin=None) -> dict:
with self.projects.local.transaction() as db:
self.projects._recover()
directory, _, _ = self.projects._load(db, project_id)
Expand All @@ -134,6 +144,8 @@ def update(self, project_id: UUID, session: str | None = None, *, draft: Draft |
if begin is not None:
if any(message['id'] == begin['id'] for message in value['messages']):
raise ProjectError('这条消息已接受,请读取对话,不要重复发送。', 409)
if before_begin is not None:
before_begin()
value['messages'].append(begin)
value['messages'].append({'id': str(uuid5(UUID(begin['id']), 'assistant')),
'role': 'assistant', 'text': '', 'status': 'streaming',
Expand Down Expand Up @@ -356,6 +368,11 @@ async def turn(project_id: UUID, value: Turn, x_opendirector_session: UUID = Hea
if value.runtime == 'jiuwenswarm' and value.thinking != 'auto':
raise ProjectError('JiuwenSwarm 当前使用原生默认推理强度。', 409)
config = await asyncio.to_thread(configs.resolve, str(value.modelId), 'agent') if spec.modelSource == 'settings' else None
if config is not None:
prepared = await asyncio.to_thread(generation.availability.prepare, config)
current = await asyncio.to_thread(configs.resolve, str(value.modelId), 'agent')
generation.availability.require(current, _assistant_request(current), prepared)
config = current
available = await skills(projects.local.repository, directory) if spec.supportsSkills else []
if set(value.skills) - {item['name'] for item in available}:
raise ProjectError('技能已失效,请重新选择。', 409)
Expand All @@ -370,6 +387,10 @@ async def turn(project_id: UUID, value: Turn, x_opendirector_session: UUID = Hea
preferences = {kind: {'modelConfigId': model_id, 'modelName': model_names.get(model_id)}
for kind, model_id in model_selections.items() if model_id}
events = RunEvents()
def validate_connection():
if config is not None:
current = configs.resolve(str(value.modelId), 'agent')
generation.availability.require(current, _assistant_request(current), prepared)
async def produce() -> None:
text, status, error, accepted = '', 'complete', None, False
activities = []
Expand All @@ -384,7 +405,8 @@ async def produce() -> None:
'skills': value.skills, 'runtime': value.runtime, 'runtimeModel': value.runtimeModel,
'modelSelections': dict(value.modelSelections),
'model': model, 'status': 'complete'}
saved = await asyncio.to_thread(conversations.update, project_id, session, begin=user, conversation_id=value.conversationId)
saved = await asyncio.to_thread(conversations.update, project_id, session, begin=user,
conversation_id=value.conversationId, before_begin=validate_connection)
accepted = True
events.put({'type': 'start', 'conversation': saved})
previous_sources = {source['id']: source for message in saved['messages'][:-2]
Expand Down
19 changes: 19 additions & 0 deletions apps/api/src/opendirector_api/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from opendirector.domain.timeline_errors import timeline_error_message

from opendirector.domain.creation.commands import CommandReceipt
from opendirector.domain.capabilities import Capability
from opendirector.domain.capability_messages import english_capability_message, missing_tool_model_message

ENGLISH_BY_CODE = {
'bigmodel_video_model': 'The BigModel video protocol supports CogVideoX-3 only.',
Expand All @@ -27,6 +29,14 @@
'kling_aspect': 'Kling keyframe generation follows the image framing. Choose Auto for frames, or a supported ratio for text and image references.',
'kling_output': 'Choose an output resolution and integer duration supported by the selected Kling model.',
'kling_cancel': 'Remote Kling cancellation is not connected. The task may continue running and incur charges.',
'capability_unavailable': 'This request is not supported.',
'capability_paused': 'Service paused. Resume it and try again.',
'image_input_count': 'Too many input images.',
'image_input_bytes': 'The input images exceed the size limit.',
'image_input_mask': 'Check the image selection.',
'tool_source_count': 'Check the number of source images.',
'tool_source_type': 'Source assets must be images.',
'capability_connection_changed': 'The model connection changed during the capability check. Submit again.',
'tool_concept_translation': 'Use a short English subject description, or add a chat model in Models to translate it automatically.',
'tool_no_video_match': 'The requested subject was not found in the video. Try a different description.',
'voice_upload_type': 'Upload the voice recording using multipart/form-data.',
Expand Down Expand Up @@ -128,12 +138,19 @@ def localized_error_for_language(
chinese: str,
status: int,
code: str = "operation_rejected",
required_capability: Capability | None = None,
) -> str:
specific = timeline_error_message(code, language)
if specific is not None:
return specific
if not wants_english_language(language):
return chinese
if code == 'tool_model_missing':
return missing_tool_model_message(required_capability, english=True)
if code.startswith(('capability_', 'image_input_', 'tool_source_')):
translated = english_capability_message(chinese)
if translated:
return translated
# A generic operation code must not hide a more specific HTTP status.
generic = code in {"operation_rejected", "invalid_input"}
if generic and status in {413, 502, 504}:
Expand All @@ -156,12 +173,14 @@ def localized_error(
chinese: str,
status: int,
code: str = "operation_rejected",
required_capability: Capability | None = None,
) -> str:
return localized_error_for_language(
request.headers.get("accept-language"),
chinese=chinese,
status=status,
code=code,
required_capability=required_capability,
)


Expand Down
Loading
Loading