Open
Conversation
tatchi
commented
Feb 5, 2026
| // Custom ticker blacklist (insider trading restrictions, etc.) | ||
| ticker_blacklist?: string[] | ||
| } | ||
| import type { AgentConfig } from "../../src/schemas/agent-config" |
Contributor
Author
There was a problem hiding this comment.
Is it ok to import outside of dashboard folder ?
Contributor
Greptile OverviewGreptile SummaryThis PR consolidates three duplicate Key changes:
Benefits:
Backward compatibility: Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/schemas/agent-config.ts | Added comprehensive inline documentation and three new required fields (llm_min_hold_minutes, allowed_exchanges, starting_equity) to centralize configuration schema with runtime validation |
| dashboard/src/types.ts | Replaced 50+ line duplicate Config interface with import from centralized AgentConfig schema, eliminating maintenance burden |
| src/durable-objects/mahoraga-harness.ts | Removed duplicate 60-line AgentConfig interface definition, now imports from centralized schema |
| src/schemas/agent-config.test.ts | Updated test fixture to include three newly required fields (llm_min_hold_minutes, allowed_exchanges, starting_equity) and added explicit return type annotation |
Sequence Diagram
sequenceDiagram
participant Dashboard as Dashboard<br/>(dashboard/src/types.ts)
participant DO as MahoragaHarness<br/>(durable-objects/mahoraga-harness.ts)
participant Schema as AgentConfigSchema<br/>(schemas/agent-config.ts)
Note over Dashboard,Schema: Before: 3 duplicate Config definitions
Note over Dashboard,Schema: After: 1 centralized source of truth
Dashboard->>DO: POST /config (partial update)
DO->>DO: Merge with DEFAULT_CONFIG
Note over DO: All required fields present<br/>(llm_min_hold_minutes,<br/>allowed_exchanges,<br/>starting_equity)
DO->>Schema: Validate with AgentConfigSchema
Schema-->>DO: ✓ Valid AgentConfig
DO->>DO: Persist to Durable Object storage
DO-->>Dashboard: Return complete config
Note over Dashboard,Schema: Type safety maintained across<br/>backend and frontend
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.