Skip to content

feat: Optimus agent #884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 74 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
97ff826
Merge pull request #826 from valory-xyz/staging
Tanya-atatakai Mar 25, 2025
8692273
Merge pull request #831 from valory-xyz/staging
Tanya-atatakai Mar 28, 2025
ed34554
Merge pull request #836 from valory-xyz/staging
Tanya-atatakai Apr 2, 2025
4390950
release: 0.2.0-rc257
Tanya-atatakai Apr 2, 2025
b595ddd
Merge branch 'staging' into staging-ea
Tanya-atatakai Apr 2, 2025
9d45e10
Merge branch 'staging-ea' of github.com:valory-xyz/olas-operate-app i…
Tanya-atatakai Apr 2, 2025
154ed2e
Merge branch 'staging' of github.com:valory-xyz/olas-operate-app into…
Tanya-atatakai Apr 2, 2025
b85354f
Merge branch 'staging-ea' of github.com:valory-xyz/olas-operate-app i…
Tanya-atatakai Apr 2, 2025
c982725
Merge branch 'staging' of github.com:valory-xyz/olas-operate-app into…
Tanya-atatakai Apr 2, 2025
c36abcc
Merge branch 'staging-ea' of github.com:valory-xyz/olas-operate-app i…
Tanya-atatakai Apr 2, 2025
df764f1
Merge pull request #844 from valory-xyz/release/020-rc257
Tanya-atatakai Apr 3, 2025
dc41039
Merge branch staging of github.com:valory-xyz/olas-operate-app into s…
Tanya-atatakai Apr 15, 2025
4802676
release: 0.2.0-rc258
Tanya-atatakai Apr 15, 2025
d35aca0
Merge pull request #852 from valory-xyz/release/020-rc258
Tanya-atatakai Apr 15, 2025
d8bdaee
release: 0.2.0-rc259
Tanya-atatakai Apr 21, 2025
a903c00
release: 0.2.0-rc260
Tanya-atatakai Apr 24, 2025
1e9b6f9
feat: Optimus agent init (#879)
mohandast52 May 8, 2025
f444216
fix: update feature flags for Optimus agent (#886)
mohandast52 May 9, 2025
b9e9274
chore: fix conflicts, merge staging
Tanya-atatakai May 9, 2025
5bfb8ae
feat: Automated bridging OLAS & ETH for Agents.fun onboarding (EA) (#…
mohandast52 May 13, 2025
08a4cb7
fix: build fixes for optimus testing and manage wallet feature (#891)
mohandast52 May 13, 2025
9e7993e
release: 0.2.0-rc270
Tanya-atatakai May 13, 2025
b7a12c1
Merge pull request #897 from valory-xyz/release/020-rc270
Tanya-atatakai May 13, 2025
1ce38a9
chore: update middleware
jmoreira-valory May 13, 2025
ea734f6
Merge pull request #899 from valory-xyz/chore/update_middleware
Tanya-atatakai May 13, 2025
520cbb4
Merge branch 'staging' into staging-ea
Tanya-atatakai May 14, 2025
a9b58bd
feat: modius bridging (#915)
mohandast52 May 22, 2025
c94a69e
chore: update middleware
jmoreira-valory May 22, 2025
98776d5
chore: conflict fixes
mohandast52 May 22, 2025
7ada98c
chore: update staging-ea with staging (#928)
mohandast52 May 23, 2025
54fb16a
feat: optimus more features (#902)
mohandast52 May 27, 2025
cdc96e9
chore: conflict fixes (#935)
mohandast52 May 27, 2025
7cbd786
chore: conflict fixes
mohandast52 May 27, 2025
190eb0b
Merge branch 'feature/optimus-agent' of github.com-personal:valory-xy…
mohandast52 May 27, 2025
5351389
feat: more optimus features (#936)
mohandast52 May 29, 2025
2bb0f30
feat: update agent profile handling for Modius and Optimus (#941)
mohandast52 May 29, 2025
339abc6
feat: update olas-operate-middleware reference to latest commit (#942)
OjusWiZard May 29, 2025
c51c2ac
feat: add .scripts/ to .gitignore for development scripts
mohandast52 May 29, 2025
86b6f36
feat: update hash for Optimus service template
mohandast52 May 29, 2025
c2171c9
feat: staging to main (#933)
mohandast52 May 30, 2025
bdc8ea6
feat: update hash for Optimus service template
mohandast52 May 30, 2025
4288415
chore: update optimus branch with main (#944)
mohandast52 May 30, 2025
3c48217
fix: poetry
jmoreira-valory May 30, 2025
b909c31
chore: merge main (conflict fixes)
mohandast52 May 30, 2025
1220fe7
feat: optimus bridging (#943)
mohandast52 Jun 2, 2025
b51f111
feat: update hash for Modius service template
mohandast52 Jun 2, 2025
2d06d8e
feat: prepend KPI description prefix to Optimus service deployment de…
mohandast52 Jun 2, 2025
e665ae9
chore: conflict fixes
mohandast52 Jun 2, 2025
9fce7a5
feat: update buttons on main page
Tanya-atatakai Jun 2, 2025
137de07
chore: review fixes
Tanya-atatakai Jun 2, 2025
08e1df2
Merge pull request #948 from valory-xyz/tatianapriemova/ope-188-updat…
Tanya-atatakai Jun 2, 2025
d49834f
chore: update middleware
jmoreira-valory Jun 2, 2025
b2a43f0
chore: update middleware
jmoreira-valory Jun 2, 2025
6800e2b
fix: slug validation
Tanya-atatakai Jun 3, 2025
30bea96
fix: updates and hash updates (#947)
mohandast52 Jun 3, 2025
8a22bc2
Merge pull request #949 from valory-xyz/tanya/fix-slug-validation
Tanya-atatakai Jun 3, 2025
1a76d32
fix: agentsfun alert shown for other agents
Tanya-atatakai Jun 3, 2025
a61f603
chore: update middleware
jmoreira-valory Jun 3, 2025
210127c
fix: breaking header (#951)
Tanya-atatakai Jun 3, 2025
e2cc024
Merge pull request #950 from valory-xyz/tatianapriemova/ope-169-x-cre…
Tanya-atatakai Jun 3, 2025
e21b82b
fix: update hash for Modius and Optimus service templates
mohandast52 Jun 3, 2025
a1bde30
release: 0.2.0-rc280
Tanya-atatakai Jun 3, 2025
a22e52e
chore: update middleware
jmoreira-valory Jun 3, 2025
55a2795
release: 0.2.0-rc281
Tanya-atatakai Jun 3, 2025
b687179
fix: update service template hashes and revert version to 0.2.0-rc267
mohandast52 Jun 4, 2025
f3d813b
chore: update olas-operate-middleware (#956)
OjusWiZard Jun 4, 2025
d57bb12
feat: optimus improvements (#953)
mohandast52 Jun 4, 2025
f69ee59
Merge branch 'feature/optimus-agent' into release/020-rc280
Tanya-atatakai Jun 4, 2025
bade9a4
Merge pull request #958 from valory-xyz/release/020-rc280
Tanya-atatakai Jun 4, 2025
1a1683c
feat: update accuracy hash (#959)
Tanya-atatakai Jun 4, 2025
a700e8b
feat: optimus improvements (#952)
mohandast52 Jun 4, 2025
7bd89b6
Merge branch 'feature/optimus-agent' of github.com-personal:valory-xy…
mohandast52 Jun 4, 2025
c600925
feat: update hashes for Optimus service templates
mohandast52 Jun 4, 2025
57ca061
chore: merge staging
mohandast52 Jun 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,8 @@ jobs:
# Download and build with PyInstaller
- name: Get trader bin
run: |
trader_version=$(poetry run python -c "import yaml; config = yaml.safe_load(open('templates/trader.yaml')); print(config['service_version'])")
echo $trader_version
make ./dist/aea_bin
#instead of this one mwe use make; mkdir dist && curl -L -o dist/aea_bin "https://github.com/valory-xyz/trader/releases/download/${trader_version}/trader_bin_${{ env.OS_ARCH }}"

# -- old optimus getter
# optimus_version=$(poetry run python -c "import yaml; config = yaml.safe_load(open('templates/optimus.yaml')); print(config['service_version'])")
# echo $optimus_version
# mkdir dist && curl -L -o dist/aea_bin "https://github.com/valory-xyz/optimus/releases/download/${$optimus_version}/optimus_bin_${{ env.OS_ARCH }}"
- name: Build with PyInstaller
run: |
poetry run pyinstaller operate/tendermint.py --onefile
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,8 @@ jobs:
# Download and build with PyInstaller
- name: Get trader bin
run: |
trader_version=$(poetry run python -c "import yaml; config = yaml.safe_load(open('templates/trader.yaml')); print(config['service_version'])")
echo $trader_version
make ./dist/aea_bin
#instead of this one mwe use make; mkdir dist && curl -L -o dist/aea_bin "https://github.com/valory-xyz/trader/releases/download/${trader_version}/trader_bin_${{ env.OS_ARCH }}"

# -- old optimus getter
# optimus_version=$(poetry run python -c "import yaml; config = yaml.safe_load(open('templates/optimus.yaml')); print(config['service_version'])")
# echo $optimus_version
# mkdir dist && curl -L -o dist/aea_bin "https://github.com/valory-xyz/optimus/releases/download/${$optimus_version}/optimus_bin_${{ env.OS_ARCH }}"
- name: Build with PyInstaller
run: |
poetry run pyinstaller operate/tendermint.py --onefile
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ leak_report
*.log

# custom script for development
.scripts/
custom-script.sh
9 changes: 0 additions & 9 deletions download_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,3 @@

BIN_DIR="electron/bins/"
mkdir -p $BIN_DIR

trader_version=$(poetry run python -c "import yaml; config = yaml.safe_load(open('templates/trader.yaml')); print(config['service_version'])")
# optimus_version=$(poetry run python -c "import yaml; config = yaml.safe_load(open('templates/optimus.yaml')); print(config['service_version'])")

# curl -L -o "${BIN_DIR}aea_bin_x64" "https://github.com/valory-xyz/optimus/releases/download/${optimus_version}/optimus_bin_x64"
# curl -L -o "${BIN_DIR}aea_bin_arm64" "https://github.com/valory-xyz/optimus/releases/download/${optimus_version}/optimus_bin_arm64"

curl -L -o "${BIN_DIR}aea_bin_x64" "https://github.com/valory-xyz/trader/releases/download/${trader_version}/trader_bin_x64"
curl -L -o "${BIN_DIR}aea_bin_arm64" "https://github.com/valory-xyz/trader/releases/download/${trader_version}/trader_bin_arm64"
Binary file added electron/public/chains/optimism-chain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions electron/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const schema = {
},
},
agentsFunCelo: { type: 'object', default: defaultInitialAgentSettings },
optimus: { type: 'object', default: defaultInitialAgentSettings },
};

/**
Expand Down
20 changes: 19 additions & 1 deletion frontend/client/enums.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
import { ValueOf } from '@/types/Util';

export enum MiddlewareAction {
STATUS = 0,
BUILD = 1,
DEPLOY = 2,
STOP = 3,
}

/**
* @note Use this enum to infer all the middleware chains existing in the system
* else use the SupportedMiddlewareChain enum for the chains that are supported by the agents and to be strictly typed.
*
* @warning The value doesn’t actually represent the real chain name;
* it reflects the open-autonomy internal name instead.
*/
export enum MiddlewareChain {
ETHEREUM = 'ethereum',
GOERLI = 'goerli',
GNOSIS = 'gnosis',
SOLANA = 'solana',
OPTIMISM = 'optimism',
OPTIMISM = 'optimistic', // @note "optimistic" and not "optimism"
BASE = 'base',
MODE = 'mode',
CELO = 'celo',
}

const MIDDLEWARE_CHAINS = {
gnosis: MiddlewareChain.GNOSIS,
optimism: MiddlewareChain.OPTIMISM,
base: MiddlewareChain.BASE,
mode: MiddlewareChain.MODE,
celo: MiddlewareChain.CELO,
} as const;
export type SupportedMiddlewareChain = ValueOf<typeof MIDDLEWARE_CHAINS>;

export enum MiddlewareLedger {
ETHEREUM = 0,
SOLANA = 1,
Expand Down
9 changes: 6 additions & 3 deletions frontend/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
MiddlewareChain,
MiddlewareDeploymentStatus,
MiddlewareLedger,
SupportedMiddlewareChain,
} from './enums';

export type ServiceHash = string;
Expand Down Expand Up @@ -62,7 +63,7 @@ export type MiddlewareServiceResponse = {
hash_history: {
[block: string]: string;
};
home_chain: MiddlewareChain;
home_chain: SupportedMiddlewareChain;
keys: ServiceKeys[];
service_path?: string;
chain_configs: {
Expand All @@ -81,8 +82,10 @@ export type ServiceTemplate = {
description: string;
image: string;
service_version: string;
home_chain: string;
configurations: { [key: string]: ConfigurationTemplate };
home_chain: SupportedMiddlewareChain;
configurations: Partial<
Record<SupportedMiddlewareChain, ConfigurationTemplate>
>;
env_variables: { [key: string]: EnvVariableAttributes };
deploy?: boolean;
};
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/AddressLink.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ReactNode } from 'react';

import { MiddlewareChain } from '@/client';
import { SupportedMiddlewareChain } from '@/client';
import { UNICODE_SYMBOLS } from '@/constants/symbols';
import { EXPLORER_URL_BY_MIDDLEWARE_CHAIN } from '@/constants/urls';
import { Address } from '@/types/Address';
import { truncateAddress } from '@/utils/truncate';

type AddressLinkProps = {
address: Address;
middlewareChain: MiddlewareChain;
middlewareChain: SupportedMiddlewareChain;
prefix?: ReactNode;
hideLinkArrow?: boolean;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const MemeooorrAgentForm = ({
}: MemeooorrAgentFormProps) => {
const [formState] = Form.useForm<MemeooorrFormValues>();

const { isMemeooorrFieldUpdateCompleted } = useSharedContext();
const { isMemeooorrFieldUpdateRequired } = useSharedContext();
const form = useMemo(
() => formInstance || formState,
[formInstance, formState],
Expand Down Expand Up @@ -158,7 +158,7 @@ export const MemeooorrAgentForm = ({
<Divider style={{ margin: '8px 0' }} />
<XAccountApiTokens
showTokensRequiredMessage={
!isMemeooorrFieldUpdateCompleted && agentFormType !== 'create'
isMemeooorrFieldUpdateRequired && agentFormType !== 'create'
}
/>

Expand Down
10 changes: 5 additions & 5 deletions frontend/components/AgentForms/common/formUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export const optionalFieldProps: FormItemProps = {
rules: [{ required: false }],
} as const;

export const modiusAgentFieldProps: FormItemProps = {
export const agentFieldProps: FormItemProps = {
...commonFieldProps,
validateFirst: true,
normalize: (value: string) => value.trim(),
} as const;

export const modiusAgentFieldOptionalProps: FormItemProps = {
export const agentFieldOptionalProps: FormItemProps = {
...optionalFieldProps,
validateFirst: true,
normalize: (value: string) => value.trim(),
Expand Down Expand Up @@ -68,10 +68,10 @@ export const validateSlug = (_: unknown, value?: string): Promise<void> => {
return Promise.reject('Please enter only the slug, not the full URL.');
}

// Slug should only contain lowercase letters, numbers, hyphens, and underscores
if (!/^[a-z0-9-_]+$/.test(value)) {
// Slug should only contain letters, numbers, hyphens, and underscores
if (!/^[a-zA-Z0-9-_]+$/.test(value)) {
return Promise.reject(
'Invalid slug format. Only lowercase letters, numbers, hyphens, and underscores are allowed.',
'Invalid slug format. Only letters, numbers, hyphens, and underscores are allowed.',
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const TenderlyAccessTokenLabel = () => (
<Paragraph className="text-sm m-0">
To locate your personal access token:
</Paragraph>
<ol className="pl-16 text-sm">
<ol className="pl-16 text-sm mb-4">
<li>
<Text className="text-sm">
Connect to{' '}
Expand Down Expand Up @@ -136,3 +136,22 @@ export const ModiusGeminiApiKeyLabel = () => (
</Text>
</Flex>
);

export const OptimusGeminiApiKeyLabel = () => (
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's a copy paste of ModiusGeminiApiKeyLabel. maybe we can either do one components with a prop = 'Optimus' | 'Modius' or just say in the description its goals through the agent’s profile ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • it’s mostly copy-pasted but not entirely—there are text-level changes specific to the agent.
  • I’m generally not in favor of adding if-else statements and introducing dependencies, as it can lead to more complexity as requirements evolve (as said in previous PRs). But in this case, I can update it since we know it’s unlikely to change. If it does, it would be better to maintain a separate copy.

<Flex align="center" gap={6}>
<Text>Gemini API key</Text>
<InfoTooltip placement="bottom" overlayInnerStyle={TOOLTIP_STYLE}>
<Paragraph className="text-sm m-0">
The Gemini API key allows you to chat with your agent and update its
goals through Optimus’ profile. You can generate one for free on{' '}
<a target="_blank" href={GEMINI_API_URL}>
Google AI Studio
</a>
.
</Paragraph>
</InfoTooltip>
<Text type="secondary" className="text-sm">
(Optional)
</Text>
</Flex>
);
26 changes: 23 additions & 3 deletions frontend/components/Layout/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Typography } from 'antd';
import { QuestionCircleOutlined, SettingOutlined } from '@ant-design/icons';
import { Button, Flex, Typography } from 'antd';
import styled from 'styled-components';

import { COLOR } from '@/constants/colors';
import { Pages } from '@/enums/Pages';
import { useElectronApi } from '@/hooks/useElectronApi';
import { usePageState } from '@/hooks/usePageState';
import { useStore } from '@/hooks/useStore';

const { Text } = Typography;
Expand All @@ -11,7 +14,6 @@ const TrafficLightIcon = styled.div`
width: 12px;
height: 12px;
border-radius: 50%;
margin-left: 8px;
-webkit-app-region: no-drag;
`;

Expand All @@ -29,6 +31,7 @@ const DisabledLight = styled(TrafficLightIcon)`

const TrafficLights = styled.div`
display: flex;
gap: 8px;
align-items: center;
margin-right: 24px;
-webkit-app-region: no-drag;
Expand All @@ -40,9 +43,10 @@ const TopBarContainer = styled.div`
left: 0;
right: 0;
z-index: 1;
height: 45px;
display: flex;
align-items: center;
padding: 10px 8px;
padding: 0px 24px;
border-radius: 8px 8px 0 0px;
border-bottom: 1px solid ${COLOR.BORDER_GRAY};
background: ${COLOR.WHITE};
Expand All @@ -52,6 +56,7 @@ const TopBarContainer = styled.div`
export const TopBar = () => {
const electronApi = useElectronApi();
const store = useStore();
const { goto } = usePageState();
const envName = store?.storeState?.environmentName;

return (
Expand All @@ -63,6 +68,21 @@ export const TopBar = () => {
</TrafficLights>

<Text>{`Pearl (beta) ${envName ? `(${envName})` : ''}`.trim()}</Text>

<Flex align="center" className="ml-auto">
<Button
type="text"
shape="circle"
icon={<QuestionCircleOutlined />}
onClick={() => goto(Pages.HelpAndSupport)}
/>
<Button
type="text"
shape="circle"
icon={<SettingOutlined />}
onClick={() => goto(Pages.Settings)}
/>
</Flex>
</TopBarContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { updateServiceIfNeeded } from '@/utils/service';
*/
const useServiceDeployment = () => {
const { showNotification } = useElectronApi();
const { isMemeooorrFieldUpdateCompleted } = useSharedContext();
const { isMemeooorrFieldUpdateRequired } = useSharedContext();

const { goto: gotoPage } = usePageState();
const { masterWallets, masterSafes, masterEoa } = useMasterWalletContext();
Expand Down Expand Up @@ -100,7 +100,7 @@ const useServiceDeployment = () => {

// agent specific checks
// If the memeooorr field update is not completed, can't start the agent
if (!isMemeooorrFieldUpdateCompleted) return false;
if (isMemeooorrFieldUpdateRequired) return false;

// allow starting based on refill requirements
return canStartAgent;
Expand All @@ -118,7 +118,7 @@ const useServiceDeployment = () => {
needsInitialFunding,
selectedStakingProgramMeta?.deprecated,
canStartAgent,
isMemeooorrFieldUpdateCompleted,
isMemeooorrFieldUpdateRequired,
]);

const pauseAllPolling = useCallback(() => {
Expand Down
Loading