Skip to content

[Request]: Decide whether respond should support inline HTML #278

Closed

Description

@jimhoyd

Tried: answer / with a tiny HTML page.
Expected: respond can return HTML directly.
Got: respond accepts only status, text and json (schema), so even a one-line page needs a separate file plus a page handler. That is 2 files where a plain server needs 0 extra.
Suggestion: a product decision: add respond.html (with contentType text/html; charset=utf-8), or document that page is the intended path and close this. Low priority and separable from the discoverability gaps above.
Evidence: Hello World A/B benchmark, 2026-09-20, URLCode 0.4.2, Sonnet 5 agents (n=1). Agent B (URLCode) succeeded with 0 failed commands but used 8 tool calls / 450k cumulative tokens (mostly cache reads) vs 1 call / 88k for a plain-Node control; 6 of its 8 calls were discovery. Raw transcripts and report: benchmarks/ab-hello-world/2026-09-20-urlcode-0.4.2/ (not yet committed).
Not verified: security implications of inline HTML in YAML (escaping, CSP interaction).

Activity

  1. added
    needs-decision
    ai-first
    enhancement
    on Sep 20, 2026
  2. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Finding: the request is already expressible without a new field. On this checkout (URLCode 0.4.2):

    version: "1"
    routes:
      /:
        respond:
          text: "<!doctype html><h1>Hello</h1>"
        response:
          headers:
            Content-Type: text/html; charset=utf-8

    urlcode validate passes and the route serves content-type: text/html; charset=utf-8 with the default nosniff and no-store. docs/HTTP.md says Content-Type may be configured on declared responses, so the gap is discoverability, not capability. The benchmark agent did not find the recipe.

    Decision: do not add respond.html; document the existing recipe instead.

    • It duplicates a working declarative path and adds vocabulary (fails the feature test in docs/PROJECT-DIRECTION.md).
    • Evidence is n=1 and the agent missed an existing option (evidence test).
    • It leans toward inline templating, which docs/ASSETS.md rules out.
    • Keep page for anything larger than a snippet.

    Follow-up (docs only): document the text + Content-Type recipe in docs/HTTP.md and the docs/AI-AUTHORING.md task table. Revisit only if later benchmark runs show authors still need html after that.

    Not verified: CSP/escaping interaction. text is served verbatim and policies.security applies as it does today; I did not test them together.

  3. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision: no respond.html. The existing respond.text plus a Content-Type: text/html header already does it; documented in #286 (docs/HTTP.md, llms.txt, docs/AI-AUTHORING.md). Revisit only if later benchmark runs show authors still need an html field.

  4. removed
    needs-decision
    on Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-firstenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions