Skip to content

cog-build: make workspace_in optional + reword to drop workspace.zip auto-link - #302

Merged
FMXExpress merged 1 commit into
mainfrom
claude/cog-build-optional-inputs
Jun 17, 2026
Merged

FMXExpress merged 1 commit into
mainfrom
claude/cog-build-optional-inputs

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Summary

Two Replicate UI field-level issues reported on the merged cog-build/ predictor:

1. workspace_in was marked required

Cog generates the OpenAPI schema from the parameter's type annotation, not the default value. So:

workspace_in: Path = Input(default=None, ...)   # ❌ schema field type = Path (required)

Replicate's UI sees a non-nullable Path, blocks the predict button until something is uploaded, no matter what the description says.

Fix:

workspace_in: Optional[Path] = Input(default=None, ...)   # ✅ schema field type = Path | None

Optional was already imported in the file (used in helper-function signatures), so the fix is just the parameter annotation.

workspace_in_url: str = Input(default="", ...) was already optional because cog treats str with default="" as optional, but it now gets the same "Leave empty for a fresh run" line in the description for consistency.

2. workspace.zip in descriptions auto-linked

Replicate's UI auto-detects filename-shaped strings and renders them as links that go nowhere useful. Reworded both descriptions to use "workspace archive" / "previous-build workspace archive" instead.

Files

cog-build/predict.py    # type annotation + reworded descriptions, no logic change
cog-build/README.md     # input table updated to match (Optional[Path], *Optional.* badges, dropped "Workspace.zip")

Test plan

  • python3 -c "import ast; ast.parse(open('cog-build/predict.py').read())" — syntax OK
  • Push the cog to Replicate and verify the UI now shows both workspace_in and workspace_in_url as optional (no asterisks / no upload-required banner).
  • Hover over the field and verify "workspace archive" renders as plain text, not as a link.

No Pascal-side changes; no behavior change in predict.py beyond the schema effect of the type-annotation fix.


Generated by Claude Code

Two field-level issues reported on the Replicate side:

1. Replicate was marking workspace_in as required even though the
   description called it optional and default=None. Cog generates
   the OpenAPI schema from the parameter's TYPE ANNOTATION, not the
   default value. `workspace_in: Path = Input(default=None, ...)`
   produces `Path` (required) in the schema; Replicate's UI then
   blocks the predict button until the user uploads something.

   Fix: annotate as `Optional[Path]` (the Optional import was
   already in the file from the helper-function signatures). Cog now
   marks the schema field nullable, Replicate shows it as optional,
   and the existing default=None means a fresh run with no input
   works.

2. Field descriptions said "workspace.zip", which Replicate's UI
   auto-detects as a filename and renders as a link (the URL goes
   nowhere useful). Reworded to "workspace archive" / "previous-
   build workspace archive". Same content, no auto-link.

Also tightened both descriptions to explicitly mention "Leave
empty for a fresh run" so the optional semantics are clear without
reading the README.

workspace_in_url stays str with default="" -- str defaults make
it optional in cog already -- but the description gets the same
"leave empty for a fresh run" line for consistency.

README updated:
  * The table column for workspace_in shows Optional[Path] now.
  * Both rows marked *Optional.* up front and reworded to drop
    "Workspace.zip" -> "workspace archive".

No Pascal-side changes. No behavior change in predict.py beyond
the schema effect of the type-annotation fix.
@FMXExpress
FMXExpress merged commit 926a3f9 into main Jun 17, 2026
khongten001 pushed a commit to khongten001/PasClaw that referenced this pull request Jul 13, 2026
The README + docs/changelog.md last entry was 2026-06-13 (FMXExpress#244). Five
substantial PRs (FMXExpress#314 FMXExpress#315 FMXExpress#316 FMXExpress#317 FMXExpress#318) and ten more feature PRs
between them and that entry shipped without changelog entries. This
brings both files current through today.

Twenty new entries (newest first, matching the existing style):

  2026-06-21
    FMXExpress#318  Relay pull-worker provider (queue + provider + /v1/relay/* HTTP)

  2026-06-20
    FMXExpress#317  pasclaw plan + build PLAN.md pickup + build --goal + cog mode
    FMXExpress#316  Cloudflare AI Gateway provider catalog rows
    FMXExpress#315  MCP progressive disclosure + tool_search
    FMXExpress#314  Stock defaults adopt lean-edit shape; fs_grep split-gate

  2026-06-18
    FMXExpress#312  Web UI workspace.zip export + import
    FMXExpress#310  Model-callable cron tool
    FMXExpress#309  FTS5 snippet window widened 24 -> 60
    FMXExpress#307  Windows cmd.exe quoting fix

  2026-06-17
    FMXExpress#306  cog-build honours profile=security sandbox
    FMXExpress#304  cog-build default profile = max-build
    FMXExpress#303  cog-build list[Path] outputs + Secret inputs + -q

  2026-06-16
    FMXExpress#302  cog-build optional workspace_in
    FMXExpress#300  pasclaw build cmd + cog-build/ predictor (parent feature)
    FMXExpress#299  Checkpoints zpaq backend + /redo
    FMXExpress#298  AGENTS.md + pasclaw init + /init
    FMXExpress#297  tool_choice force-a-specific-tool form
    FMXExpress#296  Delphi ExtraEnv injection fix
    FMXExpress#295  KB native PDF ingest

  2026-06-15
    FMXExpress#292  pasclaw profile diff + bench

Skipped per the changelog's stated convention ("Bug fixes and review
follow-ups are in the full git log"):

  FMXExpress#293  cmd/profile dcc64 fix
  FMXExpress#294  skills_manage gemini empty-enum fix
  FMXExpress#301  cmd.build dcc64 fix
  FMXExpress#311  cron dcc64 fix

Files updated identically (the docs/changelog.md note at the top says
"This file mirrors the changelog section at the top of the root
README.md"):

  M README.md           20 entries + 20 link refs added
  M docs/changelog.md   same

The link-ref block at the bottom of each file gained 20 [#NNN] entries
keeping the existing one-per-line / sorted-numerically format.
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