Skip to content

feat: agent observability evaluation - #50

Merged
hifizz merged 126 commits into
refactor-archfrom
codex/feat-agent-observability-evaluation
Sep 2, 2026
Merged

feat: agent observability evaluation#50
hifizz merged 126 commits into
refactor-archfrom
codex/feat-agent-observability-evaluation

Conversation

@hifizz

@hifizz hifizz commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added Project Workspace support for project goals, instructions, files, and shared artifacts.
    • Added project file upload, removal, search, previews, citations, and source-thread navigation.
    • Added an attachment composer demo supporting file selection, drag-and-drop, and paste.
    • Added provider-grouped model selection and private relay model support.
    • Added improved agent observability and evaluation workflows.
  • Bug Fixes

    • Protected unsent drafts from accidental selection clearing.
    • Improved code-block copying and Markdown presentation.
    • Added clearer archived-project read-only handling and file validation.

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
thread-chatbot Error Error Sep 2, 2026 3:54pm UTC

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: ca23759a-0105-43c0-8fc2-68715511a30a

📥 Commits

Reviewing files that changed from the base of the PR and between 86f9576 and 9370b2f.

⛔ Files ignored due to path filters (5)
  • evals/agent/fixtures/corrupt.pdf is excluded by !**/*.pdf
  • evals/agent/fixtures/synthetic-report.pdf is excluded by !**/*.pdf
  • evals/agent/fixtures/synthetic-status.svg is excluded by !**/*.svg
  • evals/agent/fixtures/unsupported.bin is excluded by !**/*.bin
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (197)
  • .env.example
  • .github/workflows/agent-evals-scheduled.yml
  • .github/workflows/agent-evals.yml
  • .github/workflows/openspec.yml
  • .github/workflows/project-workspace-ci.yml
  • .gitignore
  • .nvmrc
  • README.md
  • app/api/chat/route.ts
  • app/api/chat/tool-set.ts
  • app/api/thread-chat/v1/projects/[projectId]/files/[attachmentId]/route.ts
  • app/api/thread-chat/v1/projects/[projectId]/files/route.ts
  • app/thread-chat/attachment-composer-demo/page.tsx
  • app/thread-chat/branching/selection/selection-bubble.tsx
  • app/thread-chat/branching/selection/selection-draft-guard.css
  • app/thread-chat/branching/selection/use-assistant-text-selection.ts
  • app/thread-chat/chat/chat-view.tsx
  • app/thread-chat/chat/composer/attachment-composer-demo-model.ts
  • app/thread-chat/chat/composer/attachment-composer-demo.tsx
  • app/thread-chat/chat/composer/thread-model-selector.tsx
  • app/thread-chat/chat/message/markdown-body.tsx
  • app/thread-chat/core/projections.ts
  • app/thread-chat/core/store.ts
  • app/thread-chat/core/types.ts
  • app/thread-chat/gate-3-harness/mock-v1-runtime.ts
  • app/thread-chat/net/client.ts
  • app/thread-chat/net/commands/conversation-commands.ts
  • app/thread-chat/net/project-file-upload.ts
  • app/thread-chat/orchestration/artifacts/artifact-drawer.tsx
  • app/thread-chat/orchestration/artifacts/project-panel.tsx
  • app/thread-chat/orchestration/artifacts/store-bound-project-panel.tsx
  • app/thread-chat/orchestration/navigation/thread-chat-topbar.tsx
  • app/thread-chat/styles/drawer.css
  • app/thread-chat/styles/keyframes.css
  • app/thread-chat/styles/markdown.css
  • app/thread-chat/styles/scrollbar.css
  • app/thread-chat/styles/selection.css
  • app/thread-chat/styles/tokens.css
  • app/thread-chat/thread-chat-demo.tsx
  • app/thread-chat/thread-chat.css
  • components/assistant-ui/model-selector.tsx
  • constants/generation.ts
  • constants/model-call.ts
  • constants/model.ts
  • constants/observability.ts
  • constants/project-workspace.ts
  • docs/composer/01-composer-interaction-system-research.md
  • docs/composer/02-attachment-composer-demo-mvp.md
  • docs/observability/01-implementation-baseline.md
  • docs/observability/02-telemetry-foundation.md
  • docs/observability/03-agent-trace-lifecycle.md
  • docs/observability/04-provider-attempts.md
  • docs/observability/05-feedback-scores.md
  • docs/observability/06-langfuse-cloud-rollout.md
  • docs/observability/07-loop-engineering.md
  • docs/observability/08-operations-and-acceptance.md
  • docs/observability/evidence/langfuse-rollout-template.md
  • docs/project/01-project-workspace-research.md
  • docs/project/02-dependent-thread-handoff-research.md
  • docs/project/03-reference-and-outcome-preliminary-research.md
  • docs/project/04-project-mvp-scope-and-roadmap.md
  • drizzle/0006_ambitious_silk_fever.sql
  • drizzle/meta/0006_snapshot.json
  • drizzle/meta/_journal.json
  • e2e/observability/agent-trace-contract.test.mjs
  • e2e/observability/eval-foundation.test.mjs
  • e2e/observability/eval-loop.test.mjs
  • e2e/observability/eval-scorers.test.mjs
  • e2e/observability/feedback-score.test.mjs
  • e2e/observability/langfuse-release.test.mjs
  • e2e/observability/observability-foundation.test.mjs
  • e2e/observability/project-workspace-eval-harness.test.mjs
  • e2e/observability/provider-attempt.test.mjs
  • e2e/thread-chat/artifact-drawer-copy.test.mjs
  • e2e/thread-chat/attachment-composer-demo-model.test.mjs
  • e2e/thread-chat/normalized-conversation-db.test.mjs
  • e2e/thread-chat/project-artifact-context-isolation.test.mjs
  • e2e/thread-chat/project-contract-generation-boundary.test.mjs
  • e2e/thread-chat/project-panel-ui-contract.test.mjs
  • e2e/thread-chat/project-panel-workspace-state.test.mjs
  • e2e/thread-chat/project-workspace-api-db.test.mjs
  • e2e/thread-chat/project-workspace-context.test.mjs
  • e2e/thread-chat/project-workspace-db.test.mjs
  • e2e/thread-chat/project-workspace-history-stability.test.mjs
  • e2e/thread-chat/project-workspace-migration-compatibility.test.mjs
  • e2e/thread-chat/search-abort.test.mjs
  • e2e/thread-chat/verify-attachment-composer-demo.mjs
  • evals/agent/README.md
  • evals/agent/baseline.ts
  • evals/agent/baselines/fixture-ci-v1.json
  • evals/agent/baselines/fixture-scheduled-v1.json
  • evals/agent/baselines/fixture-v1.json
  • evals/agent/cases.ts
  • evals/agent/cases/core-answer.json
  • evals/agent/cases/foundation.json
  • evals/agent/cases/memory-context.json
  • evals/agent/cases/multimodal.json
  • evals/agent/cases/project-workspace.json
  • evals/agent/cases/reliability.json
  • evals/agent/cases/search-routing.json
  • evals/agent/cli.ts
  • evals/agent/compare-cli.ts
  • evals/agent/compare.ts
  • evals/agent/executors/content.ts
  • evals/agent/executors/fixture.ts
  • evals/agent/executors/lifecycle.ts
  • evals/agent/executors/production-harness.ts
  • evals/agent/fingerprint.ts
  • evals/agent/fixtures/README.md
  • evals/agent/fixtures/judge-calibration.json
  • evals/agent/fixtures/synthetic-runbook.txt
  • evals/agent/identity.ts
  • evals/agent/isolation.ts
  • evals/agent/langfuse.ts
  • evals/agent/manifest.ts
  • evals/agent/manifests/v1.json
  • evals/agent/remote-policy.ts
  • evals/agent/result.ts
  • evals/agent/runner.ts
  • evals/agent/schema.ts
  • evals/agent/scorers/aggregate.ts
  • evals/agent/scorers/deterministic.ts
  • evals/agent/scorers/helpers.ts
  • evals/agent/scorers/index.ts
  • evals/agent/scorers/judge.ts
  • evals/agent/scorers/memory.ts
  • evals/agent/scorers/search.ts
  • evals/agent/scoring.ts
  • evals/agent/selection.ts
  • instrumentation.ts
  • lib/ai/embeddings.ts
  • lib/ai/model-call-logger.ts
  • lib/ai/private-relay.ts
  • lib/ai/provider.ts
  • lib/ai/search.ts
  • lib/attachments/insights.ts
  • lib/chat/attachment-content-resolver.ts
  • lib/chat/attachment-context-policy.ts
  • lib/chat/project-contract.ts
  • lib/chat/research-router.ts
  • lib/chat/research-tools.ts
  • lib/chat/resolve-attachments.ts
  • lib/db/schema.ts
  • lib/observability/ai-sdk.ts
  • lib/observability/config.ts
  • lib/observability/context.ts
  • lib/observability/error.ts
  • lib/observability/feedback-backfill.ts
  • lib/observability/feedback-outbox.ts
  • lib/observability/feedback-post-commit.ts
  • lib/observability/feedback-score.ts
  • lib/observability/identity.ts
  • lib/observability/mask.ts
  • lib/observability/provider-attempt.ts
  • lib/observability/register-node.ts
  • lib/observability/release-readiness.ts
  • lib/observability/trace.ts
  • lib/observability/types.ts
  • lib/thread-chat/application/compile-model-context.ts
  • lib/thread-chat/application/project-mutations.ts
  • lib/thread-chat/application/queries.ts
  • lib/thread-chat/application/set-feedback.ts
  • lib/thread-chat/application/title-generator.ts
  • lib/thread-chat/contracts/commands.ts
  • lib/thread-chat/contracts/dto.ts
  • lib/thread-chat/persistence/artifact-repository.ts
  • lib/thread-chat/persistence/feedback-score-outbox-repository.ts
  • lib/thread-chat/persistence/mappers.ts
  • lib/thread-chat/persistence/project-file-repository.ts
  • lib/thread-chat/server/handlers.ts
  • lib/thread-chat/streaming/checkpoint.ts
  • lib/thread-chat/streaming/finalize.ts
  • lib/thread-chat/streaming/generation-plan.ts
  • lib/thread-chat/streaming/generation-tools.ts
  • lib/thread-chat/streaming/run-generation.ts
  • lib/thread-chat/streaming/runtime.ts
  • nixpacks.toml
  • openspec/changes/add-agent-observability-and-evaluation/.openspec.yaml
  • openspec/changes/add-agent-observability-and-evaluation/design.md
  • openspec/changes/add-agent-observability-and-evaluation/proposal.md
  • openspec/changes/add-agent-observability-and-evaluation/specs/agent-evaluation/spec.md
  • openspec/changes/add-agent-observability-and-evaluation/specs/agent-observability/spec.md
  • openspec/changes/add-agent-observability-and-evaluation/tasks.md
  • openspec/changes/add-attachment-composer-demo/.openspec.yaml
  • openspec/changes/add-attachment-composer-demo/design.md
  • openspec/changes/add-attachment-composer-demo/proposal.md
  • openspec/changes/add-attachment-composer-demo/specs/attachment-composer-demo/spec.md
  • openspec/changes/add-attachment-composer-demo/tasks.md
  • openspec/changes/add-project-workspace-mvp/.openspec.yaml
  • openspec/changes/add-project-workspace-mvp/design.md
  • openspec/changes/add-project-workspace-mvp/proposal.md
  • openspec/changes/add-project-workspace-mvp/specs/project-workspace/spec.md
  • openspec/changes/add-project-workspace-mvp/tasks.md
  • package.json
  • scripts/backfill-feedback-scores.ts
  • scripts/check-observability-release.ts
  • scripts/drain-feedback-score-outbox.ts

📝 Walkthrough

Walkthrough

The pull request adds Project Workspace management, attachment-composer demos, agent observability, feedback-score mirroring, evaluation tooling, private-relay models, database migrations, CI workflows, and supporting documentation.

Changes

Project Workspace

Layer / File(s) Summary
Project contracts, files, and persistence
lib/db/*, lib/thread-chat/contracts/*, lib/thread-chat/application/*, lib/thread-chat/persistence/*, drizzle/*
Adds versioned project contracts, project-file membership, ownership checks, idempotent mutations, artifact provenance, bootstrap data, and migration compatibility.
Generation context and client state
lib/chat/*, lib/thread-chat/application/compile-model-context.ts, lib/thread-chat/streaming/*, app/thread-chat/core/*, app/thread-chat/net/*
Injects project contracts and selected files into future generations with deterministic budgets, retrieval fallbacks, snapshots, optimistic updates, and upload/removal APIs.
Project panel and navigation
app/thread-chat/orchestration/artifacts/*, app/thread-chat/thread-chat-demo.tsx, app/thread-chat/orchestration/navigation/*, app/thread-chat/styles/*
Replaces the artifact drawer with a Project Panel containing Overview, Files, and Artifacts sections, source navigation, archived read-only handling, and responsive styling.
Workspace validation
e2e/thread-chat/project-*, e2e/thread-chat/artifact-drawer-copy.test.mjs
Validates contracts, file membership, authorization, migration compatibility, context isolation, history stability, panel behavior, and workspace-state preservation.

Agent observability and evaluation

Layer / File(s) Summary
Telemetry and trace foundation
constants/observability.ts, lib/observability/*, instrumentation.ts, app/api/chat/route.ts, lib/thread-chat/streaming/*
Adds environment-aware telemetry, deterministic identities, redaction, trace lifecycle handling, provider-attempt events, AI SDK integration, and degraded behavior when remote exporters fail.
Feedback score delivery
lib/observability/feedback-*, lib/thread-chat/application/set-feedback.ts, lib/thread-chat/server/handlers.ts, drizzle/*, scripts/*
Adds transactional outbox writes, leased retries, stale-version protection, post-commit mirroring, backfill, drain, and release-check commands.
Evaluation engine and datasets
evals/agent/*, constants/generation.ts, constants/model-call.ts, .env.example
Adds strict cases, manifests, isolated production-like execution, deterministic identities and fingerprints, scorers, judge calibration, snapshots, comparison reports, fixtures, and private-remote policy checks.
Evaluation automation
.github/workflows/agent-evals*.yml, .github/workflows/project-workspace-ci.yml, e2e/observability/*
Adds pull-request, scheduled, manual live, and Project Workspace workflows with isolated environments, baseline comparison, artifact uploads, and contract coverage.

Attachment composer, model routing, and presentation

Layer / File(s) Summary
Attachment composer demo
app/thread-chat/chat/composer/attachment-composer-demo*, app/thread-chat/attachment-composer-demo/page.tsx, e2e/thread-chat/attachment-composer-demo-model.test.mjs, e2e/thread-chat/verify-attachment-composer-demo.mjs
Adds a controlled local attachment demo with picker, drop, file paste, text paste, removal, previews, horizontal overflow, and browser validation without business uploads.
Model selector and private relay
components/assistant-ui/model-selector.tsx, app/thread-chat/chat/composer/thread-model-selector.tsx, constants/model.ts, lib/ai/private-relay.ts, lib/ai/provider.ts
Adds provider-grouped model selection, private-relay routing, seven preview models, dedicated configuration validation, and usage reporting.
Selection and Markdown presentation
app/thread-chat/branching/selection/*, app/thread-chat/chat/message/markdown-body.tsx, app/thread-chat/styles/markdown.css, app/thread-chat/styles/keyframes.css
Protects selection drafts from accidental clearing, adds Esc confirmation and ignored-selection feedback, and updates code-block, table, blockquote, scrollbar, and theme styling.

Documentation and runtime alignment

Layer / File(s) Summary
Operational specifications and guides
docs/observability/*, docs/project/*, docs/composer/*, openspec/changes/*
Documents observability policy, Project Workspace scope, attachment-composer behavior, evaluation operations, rollout controls, acceptance criteria, and implementation tasks.
Node.js and package configuration
package.json, .nvmrc, README.md, .gitignore, nixpacks.toml, .github/workflows/openspec.yml
Requires Node.js 22+, configures Node.js 24 for development and CI, adds runtime dependencies and scripts, updates ignore rules, and aligns OpenSpec validation.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ThreadChat
  participant Generation
  participant ProjectWorkspace
  participant Observability
  participant Langfuse

  ThreadChat->>Generation: Start assistant generation
  Generation->>ProjectWorkspace: Load contract and project files
  ProjectWorkspace-->>Generation: Return context snapshot and statistics
  Generation->>Observability: Record trace and model operations
  Generation->>Langfuse: Export sanitized telemetry
  Langfuse-->>Observability: Return export status
  Generation-->>ThreadChat: Stream result and terminal state
Loading
sequenceDiagram
  participant FeedbackAPI
  participant Database
  participant OutboxWorker
  participant Langfuse

  FeedbackAPI->>Database: Save feedback and enqueue versioned outbox row
  FeedbackAPI-->>ThreadChat: Return updated feedback
  OutboxWorker->>Database: Claim due row with lease
  OutboxWorker->>Langfuse: Mirror deterministic score
  Langfuse-->>OutboxWorker: Return success or failure
  OutboxWorker->>Database: Acknowledge or schedule retry
Loading
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/feat-agent-observability-evaluation

Comment @coderabbitai help to get the list of available commands.

hifizz and others added 26 commits September 1, 2026 03:51
- keep bubble open on outside click / scroll / resize while draft exists
- ignore new text selections with a draft (copy-paste into the composer)
- Esc with a draft opens a confirm dialog and shakes the bubble
- entering/shake animations moved off steady-state to avoid tc-pop replay flash
- draft-guard styles co-located with the component
- focus the question textarea only after the measured bubble becomes visible
- replay the entrance transition for every new selection
- compensate textarea borders to avoid phantom overflow
- reuse a global slim scrollbar utility with Firefox support
…esign

spec(project): 增加 Project 功能
@hifizz
hifizz merged commit 0133ca7 into refactor-arch Sep 2, 2026
3 of 6 checks passed
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.

1 participant