Skip to content

Add public mock discord runtime#21

Merged
bingran-you merged 1 commit into
mainfrom
bry/public-mock-discord-runtime
Jul 4, 2026
Merged

Add public mock discord runtime#21
bingran-you merged 1 commit into
mainfrom
bry/public-mock-discord-runtime

Conversation

@bingran-you

@bingran-you bingran-you commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add public mock-discord environment package with CLI/runtime docs, conformance fixtures, and tests
  • wire Discord into config, manifest services, CI conformance, Docker base generation, and Docker example smoke tests
  • add discord-incident-followup under both example_tasks/ and tasks/ with oracle and verifier coverage
  • redact captured webhook fixture URLs to non-secret placeholders before publication

Validation

  • uv run --extra dev pytest tests -q in packages/environments/mock-discord (139 passed)
  • uv run --extra dev pytest tests/test_conformance.py -q in packages/environments/mock-discord (32 passed, after fixture redaction)
  • python3 -m unittest tests/test_env0_control.py (23 tests OK)
  • python3 scripts/env0_control.py seed-task discord-incident-followup mock-discord
  • local mock-discord serve + oracle + verifier (reward: 1.0, no wrong-channel messages)
  • scripts/smoke_dev.sh
  • docker/build-base.sh && PULL_BASE=0 scripts/smoke_docker_examples.sh
  • BENCHFLOW_REWARD_LENIENT=1 bench eval run --tasks-dir example_tasks --include discord-incident-followup --agent oracle --sandbox docker --jobs-dir .local/bf-jobs-public-discord-example-oracle --context-root . --concurrency 1 --build-concurrency 1 (1/1, reward 1.0)
  • BENCHFLOW_REWARD_LENIENT=1 bench eval run --tasks-dir example_tasks --agent oracle --sandbox docker --jobs-dir .local/bf-jobs-public-examples-oracle-discord --context-root . --concurrency 1 --build-concurrency 1 (8/8, score 100.0%)
  • git diff --check

@bingran-you bingran-you force-pushed the bry/public-mock-discord-runtime branch from 3100944 to 91faf8d Compare July 4, 2026 21:15

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

Copy link
Copy Markdown

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: 310094419a

ℹ️ 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 .github/workflows/ci.yml
- mock-gdoc
- mock-gdrive
- mock-slack
- mock-discord

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the conformance path expected by CI

Adding mock-discord to this matrix makes the existing conformance step run uv run --extra dev pytest tests/test_conformance.py -q in packages/environments/mock-discord, but that package only adds tests/test_discord_conformance.py and no tests/test_conformance.py (confirmed with repo-wide search). As a result, every push/PR CI run for this matrix entry fails before collecting tests unless the file is renamed, a wrapper is added, or the workflow is special-cased.

Useful? React with 👍 / 👎.

engine = get_engine()
Base.metadata.drop_all(engine)
try:
result = seed_database(scenario=scenario, seed=seed)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the active DB path when reseeding

When the server is launched with the manifest/task path (--db /data/discord.db), calling /_admin/seed drops the active /data/discord.db engine and then calls seed_database() without passing that path, so seed_database resets the engine and recreates the default .data/mock_discord.db instead. This leaves the verifier DB at /data/discord.db empty/dropped after an admin reseed; capture the current engine URL and pass it as db_path, as the other services do.

Useful? React with 👍 / 👎.

Comment thread config.toml
[mock-discord]
port = 9006
db_path = "/data/discord.db"
env_var = "DISCORD_URL"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the MOCK_DISCORD_URL contract

/workspace/env0/AGENTS.md says to prefer current mock-* / MOCK_* names and not add legacy service-name contracts. Registering the new service as DISCORD_URL makes the launcher/base image expose a new legacy-style variable (and derives DISCORD_DB_PATH), so the new task prompt and Docker env codify the inconsistent contract instead of the expected MOCK_DISCORD_URL/MOCK_DISCORD_DB_PATH naming.

Useful? React with 👍 / 👎.

@bingran-you bingran-you merged commit 3dc352b into main Jul 4, 2026
11 checks passed
@bingran-you bingran-you deleted the bry/public-mock-discord-runtime branch July 4, 2026 21:20
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